Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Br 20211004 1031 #15

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Conversation

alanlhc
Copy link
Contributor

@alanlhc alanlhc commented Oct 4, 2021

[iotconnect-sdk/nrf-layer-lib/src/iotconnect_mqtt.c]

  • Remove blocking codes from iotc_nrf_mqtt_publish() to resolve deadlock issue.
  • Return assigned message id for the message send from iotc_nrf_mqtt_publish().
  • Implement message queue for messages with QOS 1 on the followings:
    • Add new message send to message queue.
    • Fire user callback with MSG_SEND_SUCCESS and remove message from queue when the message PUBACK is received.
    • Check all pending message timeout and perform re-send if needed in the iotc_nrf_mqtt_loop().
    • Fire user callback with MSG_SEND_TIMEOUT when pending message timeout and re-send count expired.
    • Clear message queue and fire user callback with MSG_SEND_FAILED when MQTT disconnected.

[iotconnect-sdk/src/iotconnect.c]

  • Modify iotconnect_sdk_send_packet() to returned assigned message id for the message send.

[iotconnect-sdk/include/iotconnect.h]

  • Add IotconnectMsgSendStatus type define.
  • Add IotConnectMsgSendStatusCallback() function type define.
  • Modify iotconnect_sdk_send_packet() declaration to return assigned message id for the message send.

[iotconnect-sdk/nrf-layer-lib/include/iotconnect_mqtt.h]

  • Add IotConnectMsgSendStatusCallback function pointer to IotconnectMqttConfig type define.
  • Modify iotc_nrf_mqtt_publish() declaration to return assigned message id for the message send.

[samples/iotc-basic/src/main.c]

  • Add message send status callback function to receive message send status from iotconnect sdk lib.
  • Modify app to wait for PUBACK for last telemetry message send before sending the next one.

[samples/iotc-sensors-gps/src/main.c]

  • Add message send status callback function to receive message send status from iotconnect sdk lib.
  • Modify app to wait for PUBACK for last telemetry message send before sending the next one.

[samples/iotc-sensors-gps/src/command_handling.c]

  • Update changes to iotconnect_sdk_send_packet().

- add IotConnectMsgSendStatusCallback() function type define.
- add msg_send_status_cb function pointer to IotconnectClientConfig type define.
- declare iotconnect_sdk_send_packet() to accept assigned msg id for the message send.
…e define.

- modify iotc_nrf_mqtt_publish() to accept assigned msg id for the message send.
…dlock issue.

- add message queue to store and re-send messages using QOS 1.
- perform checking of timeout and re-send messages in the mqtt_loop().
- modify iotc_nrf_mqtt_publish() to return assigned msg id for the message send.
- add msg_send_status_cb function pointer to allow user callback when msg sent successfully or timeout.
- add code to wait for PUBACK for the last telemetry message sent before sending the next one.
- add code to wait for PUBACK for the last telemetry message sent before sending the next one.
@alanlhc alanlhc linked an issue Oct 4, 2021 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Command acknowledgement deadlock inside the publish loop
1 participant