Hallo,
ich habe ein problem bei der übergabe von einem Array. Den möchte mir in
der Funktion send_data zunächst ausgeben lassen und dort bekomme ich
schon eine Ausgabe, wo ich nicht weiter komme und hoffe hier auf einen
Tip.
1 | int main(int argc, char *argv[]){
|
2 |
|
3 | if(FAIL != init_uart()){
|
4 | send_data(*&argv[1], argc-1)
|
5 | }
|
6 | }
|
7 | return 0;
|
8 | }
|
9 |
|
10 | static int send_data(uint8_t buffer[], int count){
|
11 | printf("Datas to send:");
|
12 | for(uint8_t x=0; x<count; x++){
|
13 | printf(" 0x%X", strtol(buffer[x], NULL, 16));
|
14 | }
|
15 | printf("\n");
|
16 | ...
|
Wenn ich das mit gcc compilieren möchte, bekommeihc die Warnung:
passing argument 1 of 'strtol' makes pointer from integer without a cast
eingabe ist char, übergabe soll uint8_t sein. Ich möchte gerne die
Funktion mit parametern aufrufen z.B.
wobei 1A 80 90 FF als HEX-Werte interpretiert werden sollen.
Hat einer einen Tip wie ich das hinbekommen kann?