Ejemplo n.º 1
0
bool SendPing(uint8_t dxl_id, int* modelnum, int* firmware_version) {
    uint8_t data[MAX_PACKET_BYTES];

    // Make packet.
    uint16_t num_parameters_tx = MakePingPacket(data, dxl_id);

    uint16_t num_parameters_rx = 4; // Error, model low, model high, firmware
    bool result = TXRXPacket(data, num_parameters_tx, num_parameters_rx);

    uint8_t error = GetByteParam(data, 0);
    if (result && error == 0) {
        *modelnum = GetWordParam(data, 1);
        *firmware_version = GetByteParam(data, 3);
        return true;
    } else {
        return false;
    }
}
Ejemplo n.º 2
0
		bool MessageGateway::Ping(NetworkAddress &address, uint16_t id)
		{
			auto packet = MakePingPacket(id);
			return SendDirectedMessage(address, ePacketIDPing, sizeof(packet), &packet);
		}