mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 01:18:36 +02:00
All: Update network names
Updates all network names, the new format is <id>_<%02d>.
This commit is contained in:
@@ -495,10 +495,10 @@ int main() {
|
||||
size_t dataLen = (frameLen > 2) ? (frameLen - 2) : 0;
|
||||
size_t numberBytesHeader = (dataLen > 1) ? 3 : 1;
|
||||
size_t numberBytesData = frameLen - numberBytesHeader;
|
||||
if(linMsg->netid == ICSNEO_NETID_LIN) {
|
||||
if(linMsg->netid == ICSNEO_NETID_LIN_01) {
|
||||
printf("LIN 1 | ID: 0x%02x [%zu] ", linMsg->header[0], dataLen);
|
||||
}
|
||||
else if (linMsg->netid == ICSNEO_NETID_LIN2) {
|
||||
else if (linMsg->netid == ICSNEO_NETID_LIN_02) {
|
||||
printf("LIN 2 | ID: 0x%02x [%zu] ", linMsg->header[0], dataLen);
|
||||
}
|
||||
|
||||
@@ -562,7 +562,7 @@ int main() {
|
||||
neomessage_can_t msg = {0};
|
||||
msg.arbid = 0x120;
|
||||
msg.length = 6;
|
||||
msg.netid = ICSNEO_NETID_HSCAN;
|
||||
msg.netid = ICSNEO_NETID_DWCAN_01;
|
||||
msg.data = sendMessageData;
|
||||
msg.description = 0x1c5; // Random description to match the receipt
|
||||
msg.status.canfdFDF = false;
|
||||
@@ -606,7 +606,7 @@ int main() {
|
||||
icsneo_describeDevice(selectedDevice, productDescription, &descriptionLength);
|
||||
|
||||
// Attempt to set baudrate and apply settings
|
||||
if(icsneo_setBaudrate(selectedDevice, ICSNEO_NETID_HSCAN, 250000) && icsneo_settingsApply(selectedDevice)) {
|
||||
if(icsneo_setBaudrate(selectedDevice, ICSNEO_NETID_DWCAN_01, 250000) && icsneo_settingsApply(selectedDevice)) {
|
||||
printf("Successfully set HS CAN baudrate for %s to 250k!\n\n", productDescription);
|
||||
} else {
|
||||
printf("Failed to set HS CAN for %s to 250k!\n\n", productDescription);
|
||||
@@ -632,7 +632,7 @@ int main() {
|
||||
icsneo_describeDevice(selectedDevice, productDescription, &descriptionLength);
|
||||
|
||||
// Attempt to set baudrate and apply settings
|
||||
if(icsneo_setBaudrate(selectedDevice, ICSNEO_NETID_HSCAN, 500000) && icsneo_settingsApply(selectedDevice)) {
|
||||
if(icsneo_setBaudrate(selectedDevice, ICSNEO_NETID_DWCAN_01, 500000) && icsneo_settingsApply(selectedDevice)) {
|
||||
printf("Successfully set HS CAN baudrate for %s to 500k!\n\n", productDescription);
|
||||
} else {
|
||||
printf("Failed to set HS CAN for %s to 500k!\n\n", productDescription);
|
||||
@@ -758,7 +758,7 @@ int main() {
|
||||
icsneo_describeDevice(selectedDevice, productDescription, &descriptionLength);
|
||||
|
||||
printf("Termination is ");
|
||||
const bool val = icsneo_isTerminationEnabledFor(selectedDevice, ICSNEO_NETID_HSCAN);
|
||||
const bool val = icsneo_isTerminationEnabledFor(selectedDevice, ICSNEO_NETID_DWCAN_01);
|
||||
neoevent_t err = { 0 };
|
||||
if(icsneo_getLastError(&err)) {
|
||||
printf("not available at this time: %s\n\n", err.description);
|
||||
@@ -776,7 +776,7 @@ int main() {
|
||||
}
|
||||
|
||||
// Attempt to set baudrate and apply settings
|
||||
if(icsneo_setTerminationFor(selectedDevice, ICSNEO_NETID_HSCAN, selection2 == '1') && icsneo_settingsApply(selectedDevice)) {
|
||||
if(icsneo_setTerminationFor(selectedDevice, ICSNEO_NETID_DWCAN_01, selection2 == '1') && icsneo_settingsApply(selectedDevice)) {
|
||||
printf("Successfully set HS CAN termination for %s!\n\n", productDescription);
|
||||
} else {
|
||||
printf("Failed to set HS CAN termination for %s!\n\n", productDescription);
|
||||
|
||||
@@ -58,7 +58,7 @@ int main() {
|
||||
msg1.Protocol = SPY_PROTOCOL_LIN;
|
||||
msg1.StatusBitField = 0;
|
||||
msg1.StatusBitField2 = 0;
|
||||
lNetworkID = NETID_LIN2;
|
||||
lNetworkID = NETID_LIN_02;
|
||||
msg1.Header[0] = 0x11; //protected ID
|
||||
msg1.Header[1] = 0xaa;
|
||||
msg1.Header[2] = 0xbb;
|
||||
@@ -80,7 +80,7 @@ int main() {
|
||||
icsSpyMessageJ1850 msg2 = {0};
|
||||
msg2.Protocol = SPY_PROTOCOL_LIN;
|
||||
msg2.StatusBitField = SPY_STATUS_INIT_MESSAGE;
|
||||
lNetworkID = NETID_LIN;
|
||||
lNetworkID = NETID_LIN_01;
|
||||
msg2.Header[0] = 0x11; //protected ID
|
||||
msg2.NumberBytesData = 0;
|
||||
msg2.NumberBytesHeader = 1;
|
||||
@@ -96,7 +96,7 @@ int main() {
|
||||
msg3.Protocol = SPY_PROTOCOL_LIN;
|
||||
msg3.StatusBitField = SPY_STATUS_INIT_MESSAGE;
|
||||
msg3.StatusBitField2 = 0;
|
||||
lNetworkID = NETID_LIN;
|
||||
lNetworkID = NETID_LIN_01;
|
||||
msg3.Header[0] = 0xe2; //protected ID
|
||||
msg3.Header[1] = 0x44;
|
||||
msg3.Header[2] = 0x33;
|
||||
@@ -131,10 +131,10 @@ int main() {
|
||||
const icsSpyMessageJ1850* linMsg = (icsSpyMessageJ1850*)&rxMsg[idx];
|
||||
size_t frameLen = (linMsg->NumberBytesHeader + linMsg->NumberBytesData);
|
||||
size_t dataLen = (frameLen > 2) ? (frameLen - 2) : 0;
|
||||
if(linMsg->NetworkID == NETID_LIN) {
|
||||
if(linMsg->NetworkID == NETID_LIN_01) {
|
||||
printf("LIN 1 | ID: 0x%02x [%zu] ", linMsg->Header[0], dataLen);
|
||||
}
|
||||
else if (linMsg->NetworkID == NETID_LIN2) {
|
||||
else if (linMsg->NetworkID == NETID_LIN_02) {
|
||||
printf("LIN 2 | ID: 0x%02x [%zu] ", linMsg->Header[0], dataLen);
|
||||
}
|
||||
|
||||
|
||||
@@ -285,7 +285,7 @@ int main() {
|
||||
msg.header[1] = 0x11;
|
||||
msg.header[2] = 0x22;
|
||||
msg.length = 10;
|
||||
msg.netid = ICSNEO_NETID_LIN;
|
||||
msg.netid = ICSNEO_NETID_LIN_01;
|
||||
msg.data = sendMessageData;
|
||||
msg.linStatus.txCommander = 1;
|
||||
msg.linStatus.txChecksumEnhanced = 1;
|
||||
@@ -347,10 +347,10 @@ int main() {
|
||||
neomessage_lin_t* linMsg = (neomessage_lin_t*)frame;
|
||||
size_t frameLen = linMsg->length;
|
||||
size_t dataLen = (frameLen > 2) ? (frameLen - 2) : 0;
|
||||
if(linMsg->netid == ICSNEO_NETID_LIN) {
|
||||
if(linMsg->netid == ICSNEO_NETID_LIN_01) {
|
||||
printf("LIN 1 | ID: 0x%02x [%zu] ", linMsg->header[0], dataLen);
|
||||
}
|
||||
else if (linMsg->netid == ICSNEO_NETID_LIN2) {
|
||||
else if (linMsg->netid == ICSNEO_NETID_LIN_02) {
|
||||
printf("LIN 2 | ID: 0x%02x [%zu] ", linMsg->header[0], dataLen);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user