} /* */ /* */ public static sbyte[] getReqLinkDevCmd(string mac) /* */ { /* 110 */ string hexMac = mac; /* 111 */ sbyte[] data = HexHelper.decodeHex(hexMac.ToCharArray()); /* */ /* 113 */ sbyte[] CMD_REQ_LINK_DEV = new sbyte[] { -86, 33, 6, 0, 0, 0, 0, 0, 0 }; /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* 125 */ for (int i = 0; i < 6; i++) /* */ { /* 127 */ CMD_REQ_LINK_DEV[(i + 3)] = data[i]; /* */ } /* 129 */ return(CMD_REQ_LINK_DEV); /* */ } /* */
/* */ /* */ public static sbyte[] getDeviceCmd(string deviceName, int devIndex) { /* 67 */ if (deviceName.Length > 16) /* */ { /* 69 */ deviceName = deviceName.Substring(0, 16); /* */ } /* */ /* 72 */ string hexDeviceName = HexHelper.encodeHexStr(deviceName.GetBytes()); /* 73 */ sbyte[] data = HexHelper.decodeHex(hexDeviceName.ToCharArray()); /* */ /* 75 */ sbyte deviceNameLen = (sbyte)data.Length; /* 76 */ sbyte payloadLen = (sbyte)(deviceNameLen + 3); /* 77 */ sbyte[] cmd_set_device_name = new sbyte[] { -86, 21, payloadLen, (sbyte)devIndex, -63, deviceNameLen }; /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* 87 */ List <sbyte?> cmd = new List <sbyte?>(); /* */ /* 89 */ for (int i = 0; i < cmd_set_device_name.Length; i++) /* */ { /* 91 */ cmd.Add(Convert.ToSByte(cmd_set_device_name[i])); /* */ } /* */ /* 94 */ for (int i = 0; i < data.Length; i++) /* */ { /* 96 */ cmd.Add(Convert.ToSByte(data[i])); /* */ } /* */ /* 99 */ sbyte[] cmdFull = new sbyte[cmd.Count]; /* 100 */ for (int i = 0; i < cmd.Count; i++) /* */ { /* 102 */ cmdFull[i] = ((sbyte?)cmd[i]).Value; /* */ } /* */ /* 105 */ return(cmdFull); /* */ } /* */