I would like to know how to request a VIN Number from c++ code
I have this code for example I can send a message but I want to send a request message for VIN Number
for example, I have the following code to send and read long messages using ISOTP CAN messages
int main(int argc, char **argv)
{
char dataReceive[64] ;
///////////////////
int s = socket(PF_CAN, SOCK_DGRAM, CAN_ISOTP);
struct ifreq ifr;
strcpy(ifr.ifr_name, "vcan0");
ioctl(s, SIOCGIFINDEX, &ifr); // ifr.ifr_ifindex gets filled
// with that device's index
struct sockaddr_can addr;
////////////////////
/* “a very long message“ */
char data[] = "a very long message";
/* create socket instance */
addr.can_family = AF_CAN;
/* address family AF_CAN */
addr.can_ifindex = ifr.ifr_ifindex;
/* CAN interface index e.g. for can0 */
addr.can_addr.tp.tx_id = 0x7DF;
/* transmit on this CAN ID */
addr.can_addr.tp.rx_id = 0x7E8;
/* receive on this CAN ID */
bind(s, (struct sockaddr *)&addr, sizeof(addr));
/* establish datagramm communication */
write(s, data, strlen(data));
while(1)
{
int limit=read(s, &dataReceive,sizeof(dataReceive));
dataReceive[limit]='\0';
cout<<endl<<dataReceive<<endl;
}
/* reception of messages */
close(s);
/* close socket instance */
return 0;
}
this code works fine but I want to send instead of this message a Request message for VIN Number
I can do it from the terminal like this
cansend can0 7df#0209020000000000 && sleep 0.01 && cansend can0 7e0#3000000000000000
but I want to do that from the code
anyone can help me with that
Hello,
What hardware are you using for CAN bus communication with the vehicles? I have experience with reading VIN from ECU in cars via the canbus, so I suppose I can help you.
Best regards,
Drago
Hello. Dear Client!
I'm a C/C++/C# expert with over 10 years of experience.
I have developed many C++ projects. I wanna work with you for a long term. Please ping me and discuss this in detail.
Best Regards.
Hi there,
I would love to help you with this one.. feel free to get in touch with a short message to start discussing how to move forwards..
Best Regards..
***requesting VIN number using isotp - CANBUS ***
Hi Sir
Professional C++ developer is ready for your project!
I have gone through your description and I'm very interesting as an expert in this field.
I'm developing C++ program for 10+ years and have excellent commands in all versions.
I will complete your project in your deadline and provide you best support on your project.
Please hire me, then you will get successful results in competitive budget.
Thank you in advance.