Problem with new SDK
Problem with new SDK
Hello, i change ma software with the new dll.
And when i send a command, i have a -166 error code.
i dont anderstand.
error code:
TKFRAME_CSAFE_FRAME_TOO_LONG_ERR 166 CSAFE frame exceeds maximum allowable frame length
someone can help me ?
excuse for my bad english, i m french
And when i send a command, i have a -166 error code.
i dont anderstand.
error code:
TKFRAME_CSAFE_FRAME_TOO_LONG_ERR 166 CSAFE frame exceeds maximum allowable frame length
someone can help me ?
excuse for my bad english, i m french
A: Are you using a PM3 or PM4?
B: Do you have the latest firmware?
I think that there might have been some increases in report sizes within the CSAFE library to allow for larger messages. The maximum report length in the previous SDK was 120, but I think they added an even larger one.
If updating your device to the latest firmware doesn't resolve your issue, then I'd be curious as to hear the following.
1: How large are your command and response buffers. (if you're using the preprocessor to declare them, what's the value of the macro).
2: When you call tkcmdsetCSAFE_command what values are you providing to cmd_data_size and rsp_data_size? (again, if you're using a macro, what's its value)
Hopefully a firmware update resolves it. If not -- the old CSAFE headers used a buffer on the order of 110 bytes. Compare your current value to the old.
Mike
B: Do you have the latest firmware?
I think that there might have been some increases in report sizes within the CSAFE library to allow for larger messages. The maximum report length in the previous SDK was 120, but I think they added an even larger one.
If updating your device to the latest firmware doesn't resolve your issue, then I'd be curious as to hear the following.
1: How large are your command and response buffers. (if you're using the preprocessor to declare them, what's the value of the macro).
2: When you call tkcmdsetCSAFE_command what values are you providing to cmd_data_size and rsp_data_size? (again, if you're using a macro, what's its value)
Hopefully a firmware update resolves it. If not -- the old CSAFE headers used a buffer on the order of 110 bytes. Compare your current value to the old.
Mike
PM4
Hello,
thank for your response.
i have a PM4 et i try the sample code given ine the documentation.
j have our he last firmware Version 21 (released November 2007)
i give you an code example:
short ecode = -1;
unsigned short rsp_size = 0;
unsigned long rsp_data[100];
unsigned long cmd_data2[] = {0xA1};
cmd_size = sizeof(cmd_data2)/sizeof(unsigned long);
ecode = tkcmdsetCSAFE_command(pDoc->m_unit_address, cmd_size, cmd_data2, &rsp_size, rsp_data);
if(ProcessError(ecode)) continue;
you think my problème can be with 'rsp_data[100];' too small ?
i'm in holiday for 7 days, i try later a bigger value.
says me if the problem can be here.
thank
thank for your response.
i have a PM4 et i try the sample code given ine the documentation.
j have our he last firmware Version 21 (released November 2007)
i give you an code example:
short ecode = -1;
unsigned short rsp_size = 0;
unsigned long rsp_data[100];
unsigned long cmd_data2[] = {0xA1};
cmd_size = sizeof(cmd_data2)/sizeof(unsigned long);
ecode = tkcmdsetCSAFE_command(pDoc->m_unit_address, cmd_size, cmd_data2, &rsp_size, rsp_data);
if(ProcessError(ecode)) continue;
you think my problème can be with 'rsp_data[100];' too small ?
i'm in holiday for 7 days, i try later a bigger value.
says me if the problem can be here.
thank
I think you just need to tell the library how much space you've allocated for a response. So rsp_size should be initialized to 100 bytes. It will be set to the number of response bytes once the function completes.
The library is trying to tell you "The response from the device would not fit into the space you had available." (that said... I wouldn't have guessed that's what it meant)
Let us know if that helps.
Code: Select all
unsigned short rsp_size = 100;
Let us know if that helps.
Last edited by haboustak on April 28th, 2008, 2:41 am, edited 1 time in total.
i will try
thank for your response,
it's logic for me our after read you.
i try when i return at home and i tell you
sebastien
it's logic for me our after read you.
i try when i return at home and i tell you
sebastien
Re: Problem with new SDK
The response buffer size must be passed into those functions requiring it and the buffer size should not exceed the size of the USB buffer; otherwise you will receive an error about "report too long". Do not pass in a zero.
In querying the USB buff size:
UINT16_T responseBuffSize;
ushort ecode = tkcmdsetDDI_max_report_size(monitorInfo.m_iDeviceNum, &responseBuffSize);
I have returned "120" as the USB buffer size.
Hope that helps anyone in the future.
In querying the USB buff size:
UINT16_T responseBuffSize;
ushort ecode = tkcmdsetDDI_max_report_size(monitorInfo.m_iDeviceNum, &responseBuffSize);
I have returned "120" as the USB buffer size.
Hope that helps anyone in the future.
Problem with new SDK
Thanks for the information, such problem may be caused by a firewall.
If you want, I can include your C# wrapper in the AMIP SDK distribution.
If you want, I can include your C# wrapper in the AMIP SDK distribution.