The string I recieve is "KBTA *EG54670000*7DC0643*1*" which matches the format of the component id request (quoted below). My question is how do I split up this string into it's respective fields, from what I can tell AngelScript doesn't have a char array representation so iterating over it is not obvious (for me anyway). My other thought was to use the CANMessageBuffer passed in the complete event, however that's a lot of translating from hex to ascii I'd rather avoid.
I saw in another post that there should be a way for the Free From Data Message to do this for me using one of the filters. It looks like the Continue Packet Definition would work for this, but I can't see how to implement this.
Can anyone point me towards an example of filtering a string?
Code: Select all
void $E_PGNRequest_ProcessComponentID$ (CANMessageBuffer @buffer)
{
// E.G.
// [make]*[model]*[serial]*[unit number]*
// incoming string = "KBTA *EG54670000*7DC0643*1*"
// make = KBTA
// model = EG54670000
// serial = 7DC0643
// unit = 1
// TODO?
}
PGN 65259 Component Identification CI
NOTE - The make, model, serial number and unit number fields in this message are optional and separated by an ASCII “*”. It is not necessary to include all fields; however, the delimiter (“*”) is always required.
Field:
a Make
Delimiter (ASCII “*”)
b Model
Delimiter (ASCII “*”)
c Serial number
Delimiter (ASCII “*”)
d Unit number (Power unit)
Delimiter (ASCII “*”)
Transmission Repetition Rate: On request
Data Length: Variable
Extended Data Page: 0
Data Page: 0
PDU Format: 254
PDU Specific: 235 PGN Supporting Information:
Default Priority: 6
Parameter Group Number: 65259 (0x00FEEB)
Start Position Length Parameter Name SPN
a - (Make) Variable - up to 5 bytes followed by an "*" delimiter
b - (Model) Variable - up to 200 bytes followed by an "*" delimiter
c - (Serial) Variable - up to 200 bytes followed by an "*" delimiter
d - (Unit) Variable - up to 200 bytes followed by an "*" delimiter