Avatar

NFC Key Hardware Id

0

Hi,

 

How can you convert the serial number of a NFC Key to a Hardware Id using the SDK?

E.g "TWFG67" to 550431034

 

Regards,

Romeo McKay

Romeo McKay

Please sign in to leave a comment.

3 comments

0
Avatar

Hi,

To start, the NFC key ID will be associated to the driver and the Hardware Id is that of the device. If I understand correctly, the connection you are looking for is; using the NFC key, find the driver/user associated, then find the vehicle that that driver is currently associated with, then find the Hardware Id of the device in that vehicle. Please correct me if I am wrong about this.

To do this you will need to make these three connections individually. Firstly, you will need to grab the user associated to the NFC key serialNumber:

api.call("Get",{"typeName":"User", "search":{
"serialNumber":"TWFG67"
}});

Then, since driver associated is not a possible search criteria in DeviceSearch, you will need to run a multicall, sending in a Get DeviceStatusInfo call for each individual vehicle on the database:

api.call("Get",
{"typeName":"DeviceStatusInfo",
"search":{"deviceSearch":{"id":"b1B"}}});

This will provide a driver --> id that is currently associated to the vehicle. You will need to find the vehicle that has the driver id from your initial user search call.

Finally, you will need to make a Get Device call to find the Hardware Id associated with this Vehicle Id:

api.call("Get",{"typeName":"Device", "search":{
"id":"b1B"
}});

Christoph Middleton 0 votes
0
Avatar

Hi Christoff, I’m not referring to the hardware id of the device. In the .NET wrapper of the Sdk the nfc key’s constructor takes in a serial number and a keyid. How do I convert the nfc key to an id. Similar to using the devicehelper class to convert from a hardwareid to a serial and vice versa.

Romeo McKay 0 votes
0
Avatar

Try just leaving hardware id null when you construct the key.

new Key(DriverKeyType.Nfc, null, "TWFG67")

Steve Hansen 0 votes