diff --git a/src/sdpd-service.c b/src/sdpd-service.c
index 39e05ab..b43ddc2 100644
--- a/src/sdpd-service.c
+++ b/src/sdpd-service.c
return NULL;
}
- lookAheadAttrId = ntohs(bt_get_unaligned((uint16_t *) (p + sizeof(uint8_t))));
+ lookAheadAttrId = bt_get_be16(p + sizeof(uint8_t));
SDPDBG("Look ahead attr id : %d", lookAheadAttrId);
SDPDBG("Unexpected end of packet");
return NULL;
}
- handle = ntohl(bt_get_unaligned((uint32_t *) (p +
- sizeof(uint8_t) + sizeof(uint16_t) +
- sizeof(uint8_t))));
+ handle = bt_get_be32(p + sizeof(uint8_t) + sizeof(uint16_t) +
+ sizeof(uint8_t));
SDPDBG("SvcRecHandle : 0x%x", handle);
rec = sdp_record_find(handle);
} else if (handleExpected != 0xffffffff)
seqlen, localExtractedLength);
dtd = *(uint8_t *) p;
- attrId = ntohs(bt_get_unaligned((uint16_t *) (p + attrSize)));
+ attrId = bt_get_be16(p + attrSize);
attrSize += sizeof(uint16_t);
SDPDBG("DTD of attrId : %d Attr id : 0x%x", dtd, attrId);
update_db_timestamp();
/* Build a rsp buffer */
- bt_put_unaligned(htonl(rec->handle), (uint32_t *) rsp->data);
+ bt_put_be32(rec->handle, rsp->data);
rsp->data_size = sizeof(uint32_t);
return 0;
invalid:
- bt_put_unaligned(htons(SDP_INVALID_SYNTAX), (uint16_t *) rsp->data);
+ bt_put_be16(SDP_INVALID_SYNTAX, rsp->data);
rsp->data_size = sizeof(uint16_t);
return -1;
int status = 0, scanned = 0;
uint8_t *p = req->buf + sizeof(sdp_pdu_hdr_t);
int bufsize = req->len - sizeof(sdp_pdu_hdr_t);
- uint32_t handle = ntohl(bt_get_unaligned((uint32_t *) p));
+ uint32_t handle = bt_get_be32(p);
SDPDBG("Svc Rec Handle: 0x%x", handle);
done:
p = rsp->data;
- bt_put_unaligned(htons(status), (uint16_t *) p);
+ bt_put_be16(status, p);
rsp->data_size = sizeof(uint16_t);
return status;
}
int service_remove_req(sdp_req_t *req, sdp_buf_t *rsp)
{
uint8_t *p = req->buf + sizeof(sdp_pdu_hdr_t);
- uint32_t handle = ntohl(bt_get_unaligned((uint32_t *) p));
+ uint32_t handle = bt_get_be32(p);
sdp_record_t *rec;
int status = 0;
}
p = rsp->data;
- bt_put_unaligned(htons(status), (uint16_t *) p);
+ bt_put_be16(status, p);
rsp->data_size = sizeof(uint16_t);
return status;