| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A1 31 前端自定义保存设置内容 #tagCSSettingData
|
| | |
|
| | | class tagCSSettingData(Structure):
|
| | | Head = tagHead()
|
| | | KeyNum = 0 #(BYTE KeyNum)// 自定义key编号,后端使用数字key存储,前端自行进行转换定义,限制100个
|
| | | DataLen = 0 #(BYTE DataLen)
|
| | | SetData = "" #(String SetData)//自定义保存的内容
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xA1
|
| | | self.Head.SubCmd = 0x31
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.KeyNum,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.DataLen,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.SetData,_pos = CommFunc.ReadString(_lpData, _pos,self.DataLen)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xA1
|
| | | self.Head.SubCmd = 0x31
|
| | | self.KeyNum = 0
|
| | | self.DataLen = 0
|
| | | self.SetData = ""
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 1
|
| | | length += 1
|
| | | length += len(self.SetData)
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteBYTE(data, self.KeyNum)
|
| | | data = CommFunc.WriteBYTE(data, self.DataLen)
|
| | | data = CommFunc.WriteString(data, self.DataLen, self.SetData)
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | KeyNum:%d,
|
| | | DataLen:%d,
|
| | | SetData:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.KeyNum,
|
| | | self.DataLen,
|
| | | self.SetData
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCSSettingData=tagCSSettingData()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCSSettingData.Head.Cmd,m_NAtagCSSettingData.Head.SubCmd))] = m_NAtagCSSettingData
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | #A1 03 设置是否成年 #tagCMAdult
|
| | |
|
| | | class tagCMAdult(Structure):
|