PAN 1026A Device Length

Hi, All!

Why does the PAN 1026A accept only device names with 8 characters … or am I making an error within the TCU INIT REQUEST ?

// !!! "ICU xxxx" and all other 8 byte strings will work !!!

char pcName[] = "ICU xxx";
unsigned char ucNameLength = strlen(pcName);
unsigned short usTotalParameterLength = (unsigned short)ucNameLength + 3;

// 100 is more than we need!
char pcRequest[100] =

// Total command length
   0x12, 0x00, 0x00,
// Ser. OpCode
   0xE1, 0x01,
// Total Parameter length - 1 !!!!
   0x0B, 0x00,
// Supported profile: 0x04, SSP   
// No other parameter
// Device name length, will be overwritten later on
// Device name, will be overwritten too.
   'X', 'X', 'X', 'X', 'X', 'X', 'X', 'X'

// Set the total parameter length
   memcpy((char*)&pcRequest[5], (char*)&usTotalParameterLength, 2);
// Set the device name length
   pcRequest[9] = ucNameLength;
// Set the device name
   memcpy((char*)&pcRequest[10], pcName, ucNameLength);

// Output the command binary
   PANPrintBuffer(pcRequest, usTotalParameterLength + 7);

The device answers with 0xE1 0xFF ???

Any ideas ?

2replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • I can confirm that the TCU_MNG_INIT_REQ command accepts device names up to 128 bytes.

    The example that you have given shows the usage of a device name with 8 bytes.

    The code that you shared correctly modifies the "parameter length" to the desired length of the name, but it fails to modify the length of the total command in the first 3 bytes of the TCU datagram.

    In the example for a device name with 8 bytes it is 0x12, but it must be increased accordingly,  too.

    For your code it must be ucNameLength + 10 in general instead.

    Because the length of the TCU datagram can never exceed 255 for TCU_MNG_INIT_REQ, it is sufficient to write:

    pcRequest[0] = ucNameLength + 10;

    Please note that for other TCU datagrams which are larger than 255 bytes it might be necessary to calculate all 3 length bytes correctly.

  • Oh my god… Thanks a lot ! For all the other commands, I did it the right way. Only for _INIT_REQ, I did it my way… (Thanks to Franky).

    Stay healthy !


Like Follow
  • Status Answered
  • 5 mths agoLast active
  • 2Replies
  • 26Views
  • 2 Following