I want to send as the response of a wifi HTTP GET, the response i have received from a GPRS HTTP GET
I have the response in a const uint8_t *buffer and the size is uint32_t len = 210, this response also contains the NewLine Characters
This is the response:
HTTP/1.1 200 OK
Date: Sat, 04 Apr 2015 17:10:51 GMT
Server: Apache
X-Powered-By: PHP/5.4.38
Connection: close
Transfer-Encoding: chunked
Content-Type: application/json
17
{"k":"vhgZs45KDwrsZSB"}
0
And I printed the content of the const uint8_t *buffer
for (uint32_t i = 0; i < len; i++) {
Serial.print(i);
Serial.print("\t");
Serial.print((char)buffer[i]);
Serial.print("\t");
Serial.println(buffer[i]);
}
0 H 72
1 T 84
2 T 84
3 P 80
4 / 47
5 1 49
6 . 46
7 1 49
8 32
9 2 50
10 0 48
11 0 48
12 32
13 O 79
14 K 75
15 13
16
10
17 D 68
18 a 97
19 t 116
20 e 101
21 : 58
22 32
23 S 83
24 a 97
25 t 116
26 , 44
27 32
28 0 48
29 4 52
30 32
31 A 65
32 p 112
33 r 114
34 32
35 2 50
36 0 48
37 1 49
38 5 53
39 32
40 1 49
41 7 55
42 : 58
43 1 49
44 0 48
45 : 58
46 5 53
47 1 49
48 32
49 G 71
50 M 77
51 T 84
52 13
53
10
54 S 83
55 e 101
56 r 114
57 v 118
58 e 101
59 r 114
60 : 58
61 32
62 A 65
63 p 112
64 a 97
65 c 99
66 h 104
67 e 101
68 13
69
10
70 X 88
71 - 45
72 P 80
73 o 111
74 w 119
75 e 101
76 r 114
77 e 101
78 d 100
79 - 45
80 B 66
81 y 121
82 : 58
83 32
84 P 80
85 H 72
86 P 80
87 / 47
88 5 53
89 . 46
90 4 52
91 . 46
92 3 51
93 8 56
94 13
95
10
96 C 67
97 o 111
98 n 110
99 n 110
100 e 101
101 c 99
102 t 116
103 i 105
104 o 111
105 n 110
106 : 58
107 32
108 c 99
109 l 108
110 o 111
111 s 115
112 e 101
113 13
114
10
115 T 84
116 r 114
117 a 97
118 n 110
119 s 115
120 f 102
121 e 101
122 r 114
123 - 45
124 E 69
125 n 110
126 c 99
127 o 111
128 d 100
129 i 105
130 n 110
131 g 103
132 : 58
133 32
134 c 99
135 h 104
136 u 117
137 n 110
138 k 107
139 e 101
140 d 100
141 13
142
10
143 C 67
144 o 111
145 n 110
146 t 116
147 e 101
148 n 110
149 t 116
150 - 45
151 T 84
152 y 121
153 p 112
154 e 101
155 : 58
156 32
157 a 97
158 p 112
159 p 112
160 l 108
161 i 105
162 c 99
163 a 97
164 t 116
165 i 105
166 o 111
167 n 110
168 / 47
169 j 106
170 s 115
171 o 111
172 n 110
173 13
174
10
175 13
176
10
177 1 49
178 7 55
179 13
180
10
181 { 123
182 " 34
183 k 107
184 " 34
185 : 58
186 " 34
187 v 118
188 h 104
189 g 103
190 Z 90
191 s 115
192 4 52
193 5 53
194 K 75
195 D 68
196 w 119
197 r 114
198 s 115
199 Z 90
200 S 83
201 B 66
202 " 34
203 } 125
204 13
205
10
206 0 48
207 13
208
10
209 13
210
10
I send all the bytes in the response buffer to the wifi response
if (recvFind(">", 5000)) {
rx_empty();
for (uint32_t i = 0; i < len; i++) {
m_puart->write((char)buffer[i]);
Serial.write((char)buffer[i]);
}
//HERE NEED TO SEND ADITIONAL CHARACTERS To fill the 210, other way no SEND OK RESPONSE
//m_puart->write(" ");
//1 for each NewLine
//1 aditional for each double NewLine
//Client side is not receiving the double NewLine
return recvFind("SEND OK", 10000);
}
It looks like wifi is missing the 10 and 13 character and also having problems with 10131013 Double NewLine
Thank you
Best regards