Problem with new SDK

Post questions and issues with Concept2 PM3 SDK
Post Reply
sensor
Paddler
Posts: 5
Joined: December 1st, 2007, 3:20 am

Problem with new SDK

Post by sensor » April 24th, 2008, 3:34 am

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

haboustak
500m Poster
Posts: 77
Joined: March 17th, 2006, 3:02 pm
Location: Cincinnati

Post by haboustak » April 25th, 2008, 6:29 pm

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

sensor
Paddler
Posts: 5
Joined: December 1st, 2007, 3:20 am

PM4

Post by sensor » April 27th, 2008, 3:55 am

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

haboustak
500m Poster
Posts: 77
Joined: March 17th, 2006, 3:02 pm
Location: Cincinnati

Post by haboustak » April 28th, 2008, 1:32 am

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.

Code: Select all

   unsigned short rsp_size = 100; 
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.
Last edited by haboustak on April 28th, 2008, 2:41 am, edited 1 time in total.

sensor
Paddler
Posts: 5
Joined: December 1st, 2007, 3:20 am

i will try

Post by sensor » April 28th, 2008, 2:36 am

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

sensor
Paddler
Posts: 5
Joined: December 1st, 2007, 3:20 am

Resolved

Post by sensor » May 25th, 2008, 1:17 pm

Thank for your code

it's ok with the size of the buffer allowed

unsigned short rsp_size = 100; //o before ..
unsigned long rsp_data[100];

the rsp_size must be at 100 in may sample before each command.

sensor

mchase
Paddler
Posts: 24
Joined: December 8th, 2010, 10:27 am

Re: Problem with new SDK

Post by mchase » November 9th, 2012, 12:28 pm

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.

pearlofet
Paddler
Posts: 6
Joined: December 26th, 2014, 9:52 am

Problem with new SDK

Post by pearlofet » June 22nd, 2015, 2:29 am

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.

Post Reply