gmLanSetPID
Syntax
gmLanSetPID(gmLanMessage msg, long v);
gmLanSetSourceId(gmLanMessage msg, long v);
gmLanSetPrio(gmLanMessage msg, long v);
gmLanGetPID(gmLanMessage msg);
gmLanGetSourceId(gmLanMessage msg);
gmLanGetPrio(gmLanMessage msg);
Function
gmLanSetPIDsets the parameter ID of the message. gmLanSetSourceIdsets the source address of the message. gmLanSetPriosets the priority of the message. gmLanGetPIDgets the parameter ID of the message. gmLanGetSourceIdgets the source address of the message. gmLanGetPriogets the priority of the message.
Parameters
msg Message
v
Parameter ID, source address or priority
Return Values
gmLanSetPID, gmLanSetSourceId, gmLanSetPrio: —
gmLanGetPID, gmLanGetSourceId, gmLanGetPrio: Parameter ID, source address or priority
Examples A GMLAN message is modified and sent withoutput(msg).The parameter ID is set with selectorgm_pid. gmLanMessage * msg1 ={SA =0x44, PRIO= 0x7, gm_pid=0x11};gmLanSetSourceId(msg1,0x55);gmLanSetPID(msg1,0x11);gmLanSetPrio(msg1,0x5);output(msg1);write("pid: 0x%x, source: 0x%x, prio: x%x",gmLanGetPID(msg1),gmLanGetSourceId(msg1),gmLanGetPrio(msg1)); Priority and source address are copied fromBattery_Voltagemessage to the new messagemsg: on gmlanmessage Battery_Voltage{gmlanmessage Battery_Voltage msg;msg = this; // SA and PRIO are not copiedgmLanSetSourceId(msg, gmLanGetSourceId(this));// Copy source address from Battery_Voltage to msggmLanSetPrio(msg, gmLanGetPrio(this));// Copy priority from Battery_Voltage to msg...}
GMLAN add-on