Lines Matching refs:pkt
173 char *pkt, const size_t start, int remain_pos) in add_passwd() argument
181 pkt[conn_flags_pos] |= 0x40; in add_passwd()
184 pkt[start] = (char)((plen >> 8) & 0xFF); in add_passwd()
185 pkt[start + 1] = (char)(plen & 0xFF); in add_passwd()
186 memcpy(&pkt[start + 2], passwd, plen); in add_passwd()
192 unsigned char *pkt, const size_t start, int remain_pos) in add_user() argument
200 pkt[conn_flags_pos] |= 0x80; in add_user()
202 pkt[start] = (unsigned char)((ulen >> 8) & 0xFF); in add_user()
203 pkt[start + 1] = (unsigned char)(ulen & 0xFF); in add_user()
204 memcpy(&pkt[start + 2], username, ulen); in add_user()
210 char *pkt, const size_t start) in add_client_id() argument
214 pkt[start] = 0x00; in add_client_id()
215 pkt[start + 1] = MQTT_CLIENTID_LEN; in add_client_id()
216 memcpy(&pkt[start + 2], client_id, MQTT_CLIENTID_LEN); in add_client_id()
520 unsigned char *pkt = NULL; in mqtt_publish() local
544 pkt = malloc(remaininglength + 1 + encodelen); in mqtt_publish()
545 if(!pkt) { in mqtt_publish()
551 pkt[i++] = MQTT_MSG_PUBLISH; in mqtt_publish()
552 memcpy(&pkt[i], encodedbytes, encodelen); in mqtt_publish()
554 pkt[i++] = (topiclen >> 8) & 0xff; in mqtt_publish()
555 pkt[i++] = (topiclen & 0xff); in mqtt_publish()
556 memcpy(&pkt[i], topic, topiclen); in mqtt_publish()
558 memcpy(&pkt[i], payload, payloadlen); in mqtt_publish()
560 result = mqtt_send(data, (char *)pkt, i); in mqtt_publish()
563 free(pkt); in mqtt_publish()