saesaria
Member level 1
- Joined
- Jun 13, 2011
- Messages
- 41
- Helped
- 2
- Reputation
- 4
- Reaction score
- 2
- Trophy points
- 1,288
- Location
- Indonesia
- Activity points
- 1,578
Hi!
I'm trying to get ONLY "+628987654321" (without quotes) from sequence string below
I tried code below
the code above gives me only "+" as the first occurrence character after string compare is match,
I want to get "+628987654321" complete string.
anyone here can share me the knowledge?
thanks.
---------- Post added at 20:41 ---------- Previous post was at 20:36 ----------
And actually I have implicit conversion of INT to PTR issue in
I'm trying to get ONLY "+628987654321" (without quotes) from sequence string below
Code ASM - [expand] 1 +CMGR: "REC UNREAD","+628987654321",,"11/07/10,18:25:40+28"
I tried code below
Code ASM - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 // LCD module connections sbit LCD_RS at PORTD6_bit; sbit LCD_EN at PORTD7_bit; sbit LCD_D4 at PORTD2_bit; sbit LCD_D5 at PORTD3_bit; sbit LCD_D6 at PORTD4_bit; sbit LCD_D7 at PORTD5_bit; sbit LCD_RS_Direction at DDD6_bit; sbit LCD_EN_Direction at DDD7_bit; sbit LCD_D4_Direction at DDD2_bit; sbit LCD_D5_Direction at DDD3_bit; sbit LCD_D6_Direction at DDD4_bit; sbit LCD_D7_Direction at DDD5_bit; // End LCD module connections char *output; int res; char txt_sub[] = "+CMGR: \"REC UNREAD\",\""; void delay() { // Function untuk delay Delay_ms(10); // delay 500 mili detik } void main() { UART1_Init(9600); // Initialize UART module at 9600 bps delay(); // Wait for UART module to stabilize lcd_init(); lcd_cmd(_lcd_clear); lcd_cmd(_lcd_cursor_off); lcd_out(1,1,"Read Data"); uart1_write_text("AT+CMGR=1\r\n"); delay(); while (1) { if (UART1_Data_Ready() == 1) { // if data is received UART1_Read_Text(output, "\",,\"", 255); // reads text until '",,"' is found res = strcmp(output,txt_sub); uart1_write(res); res = '\x0'; lcd_out(2,1,res); } } }
the code above gives me only "+" as the first occurrence character after string compare is match,
I want to get "+628987654321" complete string.
anyone here can share me the knowledge?
thanks.
---------- Post added at 20:41 ---------- Previous post was at 20:36 ----------
And actually I have implicit conversion of INT to PTR issue in
Code ASM - [expand] 1 lcd_out(2,1,res);
Last edited: