Skip to content

Commit 5c304c5

Browse files
committed
ESP-IDF and type corrections
1 parent ba6c733 commit 5c304c5

31 files changed

Lines changed: 74 additions & 66 deletions

components/robusto/conductor/Kconfig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,10 @@ menu "Conductor configuration"
7171
hex "The MAC-address of the conductor, a 6-byte hex value"
7272
depends on !ROBUSTO_CONDUCTOR_CLIENT_CONDUCTOR_MEDIA_I2C
7373
range 0x000000000000 0xFFFFFFFFFFFF
74+
default 0x000000000000
7475
help
7576
This is the MAC-address of the conductor
76-
Write it as a large hexadecimal number, for example 0x01AB11BB12BC (6*8 bits)
77+
Write it as a large hexadecimal number, for example 0x01AB11BB12BC : 6*8 bits
7778

7879
config ROBUSTO_CONDUCTOR_RETRY_WAIT_S
7980
int "Retry delay"

components/robusto/conductor/src/robusto_conductor_client.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ static network_service_t conductor_client_service = {
3333
.service_name = "Conductor client service",
3434
.incoming_callback = &on_incoming_conductor_client,
3535
.service_id = ROBUSTO_CONDUCTOR_CLIENT_SERVICE_ID,
36-
.shutdown_callback = &on_shutting_down_conductor_client,
36+
.shutdown_callback = (shutdown_cb *)&on_shutting_down_conductor_client,
3737
};
3838

3939
void on_shutting_down_conductor_client(robusto_message_t *message)
@@ -163,7 +163,7 @@ void robusto_add_conductor() {
163163
main_conductor_peer = add_peer_by_i2c_address("CONDUCTOR_MAIN", CONFIG_ROBUSTO_CONDUCTOR_CLIENT_CONDUCTOR_I2C_ADDRESS)
164164
}
165165
#else
166-
main_conductor_peer = robusto_peers_find_peer_by_base_mac_address(kconfig_mac_to_6_bytes(CONFIG_ROBUSTO_CONDUCTOR_CLIENT_CONDUCTOR_MAC_ADDRESS));
166+
main_conductor_peer = robusto_peers_find_peer_by_base_mac_address((rob_mac_address *)kconfig_mac_to_6_bytes(CONFIG_ROBUSTO_CONDUCTOR_CLIENT_CONDUCTOR_MAC_ADDRESS));
167167
if (!main_conductor_peer) {
168168
main_conductor_peer = add_peer_by_mac_address("CONDUCTOR_MAIN", kconfig_mac_to_6_bytes(CONFIG_ROBUSTO_CONDUCTOR_CLIENT_CONDUCTOR_MAC_ADDRESS), media_type);
169169
}

components/robusto/conductor/src/robusto_conductor_server.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ static network_service_t conductor_server_service = {
4747
.service_name = "Conductor server service",
4848
.incoming_callback = &on_incoming_conductor_server,
4949
.service_id = ROBUSTO_CONDUCTOR_SERVER_SERVICE_ID,
50-
.shutdown_callback = &on_shutting_down_conductor_server,
50+
.shutdown_callback = (shutdown_cb *) &on_shutting_down_conductor_server,
5151
};
5252

5353
void on_shutting_down_conductor_server(robusto_message_t *message)

components/robusto/include/robusto_message.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ fragmented_message_t * get_last_frag_message();
208208
* @param receipt Wait for a receipt
209209
* @return typedef The return value
210210
*/
211-
typedef rob_ret_val_t cb_send_message(robusto_peer_t *peer, const uint8_t *data, int len, bool receipt);
211+
typedef rob_ret_val_t cb_send_message(robusto_peer_t *peer, uint8_t *data, uint32_t len, bool receipt);
212212

213213
/**
214214
* @brief Handle incoming fragmented messaged
@@ -222,7 +222,7 @@ typedef rob_ret_val_t cb_send_message(robusto_peer_t *peer, const uint8_t *data,
222222
* @return If true, send receipt (used in initialisation, but not with parts)
223223
*/
224224

225-
bool handle_fragmented(robusto_peer_t *peer, e_media_type media_type, const uint8_t *data, int len, uint32_t fragment_size, cb_send_message * send_message);
225+
bool handle_fragmented(robusto_peer_t *peer, e_media_type media_type, uint8_t *data, int len, uint32_t fragment_size, cb_send_message * send_message);
226226

227227

228228
/**

components/robusto/misc/src/pubsub/robusto_pubsub_client.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ subscribed_topic_t *robusto_pubsub_client_get_topic(robusto_peer_t *peer, char *
323323
void recover_topic(subscribed_topic_t *topic)
324324
{
325325
robusto_pubsub_client_get_topic(topic->peer, topic->topic_name, topic->callback, topic->display_offset);
326-
if (topic->state == TOPIC_STATE_PROBLEM && !robusto_waitfor_byte_change(&topic->state, 1000) != ROB_OK)
326+
if (topic->state == TOPIC_STATE_PROBLEM && !robusto_waitfor_byte_change((uint8_t *)&topic->state, 1000) != ROB_OK)
327327
{
328328
ROB_LOGE(pubsub_client_log_prefix, "Failed to recover %s using the %s peer", topic->topic_name, topic->peer->name);
329329
topic->state = TOPIC_STATE_PROBLEM;
@@ -353,7 +353,7 @@ void create_topic_recovery_task(subscribed_topic_t *topic)
353353
topic->topic_name, topic->peer->name);
354354
char *task_name;
355355
robusto_asprintf(&task_name, "Recovery task task for %s topic, peer %s", topic->topic_name, topic->peer->name);
356-
if (robusto_create_task(&recover_topic, topic, task_name, NULL, 0) != ROB_OK)
356+
if (robusto_create_task((TaskFunction_t)&recover_topic, topic, task_name, NULL, 0) != ROB_OK)
357357
{
358358
ROB_LOGE(pubsub_client_log_prefix, "Failed creating a recovery task for %s topic, peer %s", topic->topic_name, topic->peer->name);
359359
}

components/robusto/misc/src/pubsub/robusto_pubsub_server.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ uint32_t robusto_pubsub_server_unsubscribe(robusto_peer_t *peer, pubsub_server_s
135135
return ROB_OK;
136136
}
137137

138-
rob_ret_val_t publish_topic(pubsub_server_topic_t * topic, pubsub_server_subscriber_t *subscriber, uint* data, int data_length) {
138+
rob_ret_val_t publish_topic(pubsub_server_topic_t * topic, pubsub_server_subscriber_t *subscriber, uint8_t* data, int data_length) {
139139
if (subscriber->local_callback) {
140140
ROB_LOGI(pubsub_log_prefix, "Publishing %s to callback", topic->name);
141141
subscriber->local_callback(data, data_length);

components/robusto/misc/src/umts/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ config ROBUSTO_UMTS_SERVER
66
The UMTS gateway allows access to the cellular network and presents two services:
77
1. Sending MQTT messages to a predefined server
88
2. Sending SMS messages to a specified recipient
9+
Note: Needs ROBUSTO_UMTS_SERVER to be enabled.
910

1011
menu "UMTS gateway configuration"
1112
depends on ROBUSTO_UMTS_SERVER

components/robusto/misc/src/umts/robusto_umts.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ void robusto_umts_init(char *_log_prefix)
136136
umts_event_group = xEventGroupCreate();
137137
xEventGroupClearBits(umts_event_group, GSM_CONNECT_BIT | GSM_GOT_DATA_BIT | GSM_SHUTTING_DOWN_BIT);
138138

139-
umts_init_queue(&umts_do_on_work_cb, umts_log_prefix);
139+
umts_init_queue((work_callback *)&umts_do_on_work_cb, umts_log_prefix);
140140

141141
ROB_LOGI(umts_log_prefix, "* Registering GSM main task...");
142142
int rc = xTaskCreatePinnedToCore((TaskFunction_t)robusto_umts_start, "UMTS main task", /*8192*/ /*16384*/ 32768,

components/robusto/misc/src/umts/robusto_umts_ip.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
#include "freertos/event_groups.h"
55

66
#include <esp_netif.h>
7+
8+
#ifndef CONFIG_PPP_SUPPORT
9+
#error "The Robusto UMTS server requires PPP support. Please enable CONFIG_PPP_SUPPORT."
10+
#endif
11+
712
#include <esp_netif_ppp.h>
813

914
#include <esp_modem_api.h>

components/robusto/misc/src/umts/robusto_umts_queue.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ static char *umts_queue_log_prefix;
2626
STAILQ_HEAD(umts_work_q, umts_queue_item) umts_work_q;
2727

2828
struct umts_queue_item_t *umts_first_queueitem() {
29-
return STAILQ_FIRST(&umts_work_q);
29+
return (struct umts_queue_item_t *) STAILQ_FIRST(&umts_work_q);
3030
}
3131

3232

@@ -38,13 +38,14 @@ void umts_insert_tail(umts_queue_item_t *new_item) {
3838
}
3939

4040
rob_ret_val_t umts_safe_add_work_queue(umts_queue_item_t *new_item) {
41-
return safe_add_work_queue(&umts_queue_context, new_item);
41+
return safe_add_work_queue(&umts_queue_context, new_item, false);
4242
}
4343
void umts_cleanup_queue_task(umts_queue_item_t *queue_item) {
4444
if (queue_item != NULL)
4545
{
46-
robusto_message_free(queue_item->topic);
47-
robusto_message_free(queue_item->data);
46+
robusto_free(queue_item->topic);
47+
robusto_free(queue_item->data);
48+
robusto_free(queue_item->state);
4849
robusto_free(queue_item);
4950
}
5051
cleanup_queue_task(&umts_queue_context);
@@ -65,9 +66,9 @@ rob_ret_val_t umts_init_queue(work_callback work_cb, char *_log_prefix)
6566
// Initialize the work queue
6667
STAILQ_INIT(&umts_work_q);
6768

68-
umts_queue_context.first_queue_item_cb = &umts_first_queueitem;
69-
umts_queue_context.remove_first_queueitem_cb = &umts_remove_first_queue_item;
70-
umts_queue_context.insert_tail_cb = &umts_insert_tail;
69+
umts_queue_context.first_queue_item_cb = (first_queueitem *)&umts_first_queueitem;
70+
umts_queue_context.remove_first_queueitem_cb = (remove_first_queueitem *)&umts_remove_first_queue_item;
71+
umts_queue_context.insert_tail_cb = (insert_queue_item *)&umts_insert_tail;
7172
umts_queue_context.insert_head_cb = NULL;
7273
umts_queue_context.on_work_cb = work_cb;
7374
umts_queue_context.max_task_count = 1;

0 commit comments

Comments
 (0)