PSoC4200 Tx Example.cydsn/Generated_Source/PSoC4/XBEE.c
uint8_t XBEE_ATCommand(XBEE_packet_t * packet, uint8_t frameId, char * AT, uint8 * value, uint8 valueLen) {
    /* Length */
    packet->length = 4 + valueLen;
    /* API Identifier */
    packet->payload[0] = XBEE_APIID_AT_COMMAND;
    /* Frame Id */
    packet->payload[1] = frameId;
    /* AT Command */
    packet->payload[2] = AT[0];
    packet->payload[3] = AT[1];
    /* Parameter value */
    memcpy(&(packet->payload[4]), value, valueLen);
    /* Checksum */
    packet->checksum = XBEE_Checksum(packet);
    
    XBEE_Issue(packet);
    
    return 0;
}
/**
* Issue AT commands to XBee module. 
*
* @param packet A pointer to the XBEE_packet_t where data is going to be stored.
* @param frameId Frame identifier. Note: If Frame ID = 0 in AT Command Mode, no
* AT Command Response will be given.
* @param AT 2-byte array of the AT command.
* @param value Ponter to an array containing the paramter value.
* @param RFDataLen Length of the value array.
* @return Always 0.
*/
Issue AT commands to XBee module.
Issue AT commands to XBee module .
uint8_t XBEE_ATCommand(XBEE_packet_t * packet, uint8_t frameId, char * AT, uint8 * value, uint8 valueLen) {
    packet->length = 4 + valueLen;
    packet->payload[0] = XBEE_APIID_AT_COMMAND;
    packet->payload[1] = frameId;
    packet->payload[2] = AT[0];
    packet->payload[3] = AT[1];
    memcpy(&(packet->payload[4]), value, valueLen);
    packet->checksum = XBEE_Checksum(packet);
    XBEE_Issue(packet);
    return 0;
}
uint8_t XBEE_ATCommand ( XBEE_packet_t * packet , uint8_t frameId , char * AT , uint8 * value , uint8 valueLen ) { packet -> length = 4 + valueLen ; packet -> payload [ 0 ] = XBEE_APIID_AT_COMMAND ; packet -> payload [ 1 ] = frameId ; packet -> payload [ 2 ] = AT [ 0 ] ; packet -> payload [ 3 ] = AT [ 1 ] ; memcpy ( & ( packet -> payload [ 4 ] ) , value , valueLen ) ; packet -> checksum = XBEE_Checksum ( packet ) ; XBEE_Issue ( packet ) ; return 0 ; }
Issue AT commands to XBee module.
Issue AT commands to XBee module .
/* Length */ /* API Identifier */ /* Frame Id */ /* AT Command */ /* Parameter value */ /* Checksum */