Linking as a controller

The first part of the grouping is linking the PLM to the target device as a controller. As mentioned previously, this is relatively easy, with the only problematic part being knowing which PLM group corresponds with which target group. I have decided to put the target group in the lowest "link specific" byte which appears to correspond to the firmware revision of the device. plcd does not use this for anything specific and I cannot think of anything else that might use it, or if it does, how it is used. Here is the command chain while linking

plcd[2518]: PLMProtocol::LinkDevice: linking 1a1e8c02
plcd[2518]: PLMProtocol::GetNextLinkNumber: Next group is 1
plcd[2518]: PLMProtocol::LinkDevice:     sent: 02640101
plcd[2518]: PLMProtocol::LinkDevice: received: 0264010106
plcd[2518]: PLMProtocol::LinkDevice:            sent: 02621a1e8c0f0903
plcd[2518]: PLMProtocol::LinkDevice: received    ack: 02621a1e8c0f090306
plcd[2518]: PLMProtocol::LinkDevice received remote ack: 02501a1e8c1cf4602b0903
plcd[2518]: PLMProtocol::LinkDevice received all link completed: 025301011a1e8c020f36
plcd[2518]: PLMProtocol::LinkDevice:     sent: 026f0000011a1e8c000000
plcd[2518]: PLMProtocol::LinkDevice: received: 026f0000011a1e8c00000006
plcd[2518]: PLMProtocol::ReceiveLinkRecord received: 0257e2011a1e8c020f36
plcd[2518]: PLMProtocol::LinkDevice received all link record: 026f20e2011a1e8c020f0306

Here is the read back when plcd starts

plcd[2525]: PLMProtocol::GetPLMLinkDatabase:     sent: 0269
plcd[2525]: PLMProtocol::GetPLMLinkDatabase: received: 026906
plcd[2525]: PLMProtocol::ReceiveLinkRecord received: 0257e2011a1e8c020f03
plcd[2525]: PLMProtocol::GetPLMLinkDatabase: Mapping 1a1e8c02 to group 1
plcd[2525]: PLMProtocol::GetPLMLinkDatabase:     sent: 026a
plcd[2525]: PLMProtocol::GetPLMLinkDatabase: received: 026a06
plcd[2525]: PLMProtocol::ReceiveLinkRecord received: 0257e2021a1e8c020f04
plcd[2525]: PLMProtocol::GetPLMLinkDatabase: Mapping 1a1e8c03 to group 2
plcd[2525]: PLMProtocol::GetPLMLinkDatabase:     sent: 026a
plcd[2525]: PLMProtocol::GetPLMLinkDatabase: received: 026a15

Next I will rewrite the command send code to control the groups instead of using direct commands, then I will tackle linking as a responder.

Subject: