diff --git a/lib/sdp.c b/lib/sdp.c
index 36b4d08..009d8a1 100644
--- a/lib/sdp.c
+++ b/lib/sdp.c
case SDP_ALT16:
case SDP_TEXT_STR16:
case SDP_URL_STR16:
- bt_put_unaligned(htons(length), (uint16_t *) ptr);
+ bt_put_be16(length, ptr);
break;
case SDP_SEQ32:
case SDP_ALT32:
case SDP_TEXT_STR32:
case SDP_URL_STR32:
- bt_put_unaligned(htonl(length), (uint32_t *) ptr);
+ bt_put_be32(length, ptr);
break;
}
}
/* data type for attr */
*p++ = SDP_UINT16;
buf->data_size = sizeof(uint8_t);
- bt_put_unaligned(htons(attr), (uint16_t *) p);
+ bt_put_be16(attr, p);
buf->data_size += sizeof(uint16_t);
}
*(uint8_t *) p = dst->data_size - sizeof(uint8_t) - sizeof(uint8_t);
break;
case SDP_SEQ16:
- bt_put_unaligned(htons(dst->data_size - sizeof(uint8_t) - sizeof(uint16_t)), (uint16_t *) p);
+ bt_put_be16(dst->data_size - sizeof(uint8_t) - sizeof(uint16_t), p);
break;
case SDP_SEQ32:
- bt_put_unaligned(htonl(dst->data_size - sizeof(uint8_t) - sizeof(uint32_t)), (uint32_t *) p);
+ bt_put_be32(dst->data_size - sizeof(uint8_t) - sizeof(uint32_t), p);
break;
}
}
p = reqbuf + sizeof(sdp_pdu_hdr_t);
reqsize = sizeof(sdp_pdu_hdr_t);
- bt_put_unaligned(htonl(handle), (uint32_t *) p);
+ bt_put_be32(handle, p);
reqsize += sizeof(uint32_t);
reqhdr->plen = htons(reqsize - sizeof(sdp_pdu_hdr_t));
p = reqbuf + sizeof(sdp_pdu_hdr_t);
reqsize = sizeof(sdp_pdu_hdr_t);
- bt_put_unaligned(htonl(handle), (uint32_t *) p);
+ bt_put_be32(handle, p);
reqsize += sizeof(uint32_t);
p += sizeof(uint32_t);
pdata += seqlen;
/* specify the maximum svc rec count that client expects */
- bt_put_unaligned(htons(max_rec_num), (uint16_t *) pdata);
+ bt_put_be16(max_rec_num, pdata);
reqsize += sizeof(uint16_t);
pdata += sizeof(uint16_t);
reqsize = sizeof(sdp_pdu_hdr_t);
/* add the service record handle */
- bt_put_unaligned(htonl(handle), (uint32_t *) pdata);
+ bt_put_be32(handle, pdata);
reqsize += sizeof(uint32_t);
pdata += sizeof(uint32_t);
/* specify the response limit */
- bt_put_unaligned(htons(65535), (uint16_t *) pdata);
+ bt_put_be16(65535, pdata);
reqsize += sizeof(uint16_t);
pdata += sizeof(uint16_t);
t->reqsize += seqlen;
pdata += seqlen;
- bt_put_unaligned(htons(max_rec_num), (uint16_t *) pdata);
+ bt_put_be16(max_rec_num, pdata);
t->reqsize += sizeof(uint16_t);
pdata += sizeof(uint16_t);
t->reqsize = sizeof(sdp_pdu_hdr_t);
/* add the service record handle */
- bt_put_unaligned(htonl(handle), (uint32_t *) pdata);
+ bt_put_be32(handle, pdata);
t->reqsize += sizeof(uint32_t);
pdata += sizeof(uint32_t);
/* specify the response limit */
- bt_put_unaligned(htons(65535), (uint16_t *) pdata);
+ bt_put_be16(65535, pdata);
t->reqsize += sizeof(uint16_t);
pdata += sizeof(uint16_t);
t->reqsize += seqlen;
pdata += seqlen;
- bt_put_unaligned(htons(SDP_MAX_ATTR_LEN), (uint16_t *) pdata);
+ bt_put_be16(SDP_MAX_ATTR_LEN, pdata);
t->reqsize += sizeof(uint16_t);
pdata += sizeof(uint16_t);
reqsize += seqlen;
pdata += seqlen;
- bt_put_unaligned(htons(SDP_MAX_ATTR_LEN), (uint16_t *) pdata);
+ bt_put_be16(SDP_MAX_ATTR_LEN, pdata);
reqsize += sizeof(uint16_t);
pdata += sizeof(uint16_t);