Hello Experts,
I am struggling to access SDS application layer using Softing CAN Layer2 CANL2_send_data() function. The CAN interface was successfully initialized and ready for writing and reading.
int CANL2_send_data(CAN_HANDLE can, unsigned long Ident, int Xtd, int DataLength, byte *pData);
Function Parameters:
- can: Channel handle
- Ident: Identifier
- Xtd: Identifier length (0: 11 bits, 1: 29 bits)
- DataLength: Number of data bytes to be transmitted
SDS header info:
Logical Address: 64
Service Type: 100 (write)
Identifier: 0x204
Service Parameter: Attribute 206
Data: (data format?)
//////////////////////////////////////////////////////////////////////////
Problems:
1. SDS data frame showing missing first 2 bytes (72 65) from “reboot\r\n” (72 65 62 6f 6f 74 0d 0a). The output is captured in CAN/SDS monitor on other PC with CANusb located at the same bus.
2. DLC is reduced into 6 (SDS max data bytes) but how send data that is more 6 bytes?
3. SDS parameters such as Service Specifiers, EOID, Service Parameters did not find their slots in above CAN send data function.
4. FRC returned 0, the data did reach the microcontroller (confirmed with CAN RX LED indicator) but it does not response accordingly.
Thanks in advanced
mraaf
What I have tried:
unsigned char* pData = "reboot\r\n";
int nLength = strlen((const char*)pData);
static unsigned int nID = 0x204;
int frc;
frc = CANL2_send_data(
m_hCAN[1],
nID,
0,
nLength,
pData);
Quote:
SDS Data Output:
Tx/Rx: Rx | Direction: [IN] | Address: 64 | APDU: Write | DLC: 6 | Data: 62 6f 6f 74 d a | frc: 0
///////////////////////////////////////////////////////////////////////
Function return codes:
0 Function successful
-1 Function not successful
-11 Unknown error
-104 Timeout firmware communication
-1000 Invalid channel handle