Jörg Wempe / Mbed OS Nucleo_L432KC_Test

Dependencies:   BufferedSerial SDFileSystem

funktions.h

Committer:
JoergWempe
Date:
2019-04-09
Revision:
2:6bb642c850bc

File content as of revision 2:6bb642c850bc:

//funktionen

void sendData(string dataForTX)
{
    uint8_t n = dataForTX.length();
    uint8_t cs = 0;
    char command[3]= {0x02,0x00,n};
    for (int p=0; p<3; p++) {
        cs = cs ^ command[p];
        AMB.printf("%c",command[p]);
        // pc.printf("%c",command[p]);
    }
    for (int p=0; p<n; p++) {
        cs = cs ^ dataForTX[p];
        AMB.printf("%c",dataForTX[p]);
        // pc.printf("%c",dataForTX[p]);
    }
    AMB.printf("%c",cs);
    //pc.printf("%c",cs);
}