![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
BLEUART
Fork of 0925BLEonly by
Diff: main.cpp
- Revision:
- 4:d1480d298d7f
- Parent:
- 3:837f3a27c2f7
- Child:
- 5:c459bdd60522
--- a/main.cpp Fri Sep 29 08:19:19 2017 +0000 +++ b/main.cpp Fri Sep 29 08:51:40 2017 +0000 @@ -83,24 +83,22 @@ } if(((*(params->data))=='<')&&((*(params->data+1))=='E')&&((*(params->data+2))=='>')){ // <E> - char buf[255]; - char *ptr1,*ptr2; - int n,len1=3,len2=3; - - ptr1 = strstr(longble,"<S>") + len1; - ptr2 = strstr(ptr1,"<E>"); - n=strlen(longble)-len1-len2; - strncpy(buf,ptr1,n); - buf[n]='\0'; - pc.printf("%s\n",buf); - - // uint8_t *a; // a=longble; // a+=3; - // longble=a; - pc.printf("%S\r\n",longble) ; - pc.printf("%d\r\n",(sizeof(longble))) ; + /* for(uint8_t a=0;a<252;a++){ + longble[a]=longble[a+3]; + }*/ + + uint8_t target[255]; + + memcpy( target, longble + 3, strlen((const char*)longble) ); + + //Serial.print(strlen(target)); + + pc.printf("%S\r\n",target); + // pc.printf("%S\r\n",longble) ; + // pc.printf("%d\r\n",(sizeof(longble))) ; } uint8_t blein[params->len]; for(uint8_t count=0 ; count<((params->len)) ; ++count){ //取得藍芽資料