Need Assistance :) UART_SEND and UART_SendString.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Need Assistance :) UART_SEND and UART_SendString.

759 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by JJClyne on Wed May 30 09:30:07 MST 2012
Hello everyone,

I need some help to send a character over to my GSM Module.

Does anyone knows how to send Control Z via Uart ?


I've tried many possible combinations to no avil. Any kind souls around ? Been stuck hours trying to solve this.

strcpy(msg,"Sent From MCU" +char(26));
UART_Send(LPC_UART3, (uint8_t *)msg , strlen(msg), BLOCKING); //strlen :Length of Transmit buffer Checking Blocking.
0 Kudos
Reply
2 Replies

730 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by frame on Thu May 31 04:20:39 MST 2012

Quote:

[B]strcpy(msg,"Sent From MCU" +char(26));[/B]

What is this ?
You don't want to use BASIC or C#, do you ?

C does not have a dedicated string data type, only character arrays.
Look for the [B][FONT=Courier New]strcat()[/FONT] [/B]manpage, how to concatenate 'strings' together.

As cmcquaid suggested, you can embed character constants in strings with a leading backslash, either octal ('\0<nn>'), decimal ('\<nn>') or hexadecimal ('\0x<nn>').
0 Kudos
Reply

730 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by cmcquaid on Wed May 30 10:21:26 MST 2012
You can use the octal form as an escape sequence

strcpy(msg,"Sent From MCU \032" );
UART_Send( ....
0 Kudos
Reply