Add ifdef to bit definitions to avoid conflicts with other libraries. Refactor BITx to use BIT macro. (#45)
This commit is contained in:
@@ -447,7 +447,7 @@ static bool dlmstp_compare_data_expecting_reply(
|
||||
}
|
||||
request.invoke_id = request_pdu[offset + 2];
|
||||
/* segmented message? */
|
||||
if (request_pdu[offset] & BIT3) {
|
||||
if (request_pdu[offset] & BIT(3)) {
|
||||
request.service_choice = request_pdu[offset + 5];
|
||||
} else {
|
||||
request.service_choice = request_pdu[offset + 3];
|
||||
@@ -475,7 +475,7 @@ static bool dlmstp_compare_data_expecting_reply(
|
||||
case PDU_TYPE_COMPLEX_ACK:
|
||||
reply.invoke_id = reply_pdu[offset + 1];
|
||||
/* segmented message? */
|
||||
if (reply_pdu[offset] & BIT3) {
|
||||
if (reply_pdu[offset] & BIT(3)) {
|
||||
reply.service_choice = reply_pdu[offset + 4];
|
||||
} else {
|
||||
reply.service_choice = reply_pdu[offset + 2];
|
||||
|
||||
@@ -444,7 +444,7 @@ bool dlmstp_compare_data_expecting_reply(
|
||||
}
|
||||
request.invoke_id = request_pdu[offset + 2];
|
||||
/* segmented message? */
|
||||
if (request_pdu[offset] & BIT3) {
|
||||
if (request_pdu[offset] & BIT(3)) {
|
||||
request.service_choice = request_pdu[offset + 5];
|
||||
} else {
|
||||
request.service_choice = request_pdu[offset + 3];
|
||||
@@ -472,7 +472,7 @@ bool dlmstp_compare_data_expecting_reply(
|
||||
case PDU_TYPE_COMPLEX_ACK:
|
||||
reply.invoke_id = reply_pdu[offset + 1];
|
||||
/* segmented message? */
|
||||
if (reply_pdu[offset] & BIT3) {
|
||||
if (reply_pdu[offset] & BIT(3)) {
|
||||
reply.service_choice = reply_pdu[offset + 4];
|
||||
} else {
|
||||
reply.service_choice = reply_pdu[offset + 2];
|
||||
|
||||
Reference in New Issue
Block a user