@@ -197,8 +197,8 @@ static struct mqtt_sn_publish *mqtt_sn_publish_create(struct mqtt_sn_data *data)
197
197
return pub ;
198
198
}
199
199
200
- static struct mqtt_sn_publish * mqtt_sn_publish_find_msg_id (struct mqtt_sn_client * client ,
201
- uint16_t msg_id )
200
+ static struct mqtt_sn_publish * mqtt_sn_publish_find_by_msg_id (struct mqtt_sn_client * client ,
201
+ uint16_t msg_id )
202
202
{
203
203
struct mqtt_sn_publish * pub ;
204
204
@@ -211,8 +211,8 @@ static struct mqtt_sn_publish *mqtt_sn_publish_find_msg_id(struct mqtt_sn_client
211
211
return NULL ;
212
212
}
213
213
214
- static struct mqtt_sn_publish * mqtt_sn_publish_find_topic (struct mqtt_sn_client * client ,
215
- struct mqtt_sn_topic * topic )
214
+ static struct mqtt_sn_publish * mqtt_sn_publish_find_by_topic (struct mqtt_sn_client * client ,
215
+ struct mqtt_sn_topic * topic )
216
216
{
217
217
struct mqtt_sn_publish * pub ;
218
218
@@ -254,8 +254,8 @@ static struct mqtt_sn_topic *mqtt_sn_topic_create(struct mqtt_sn_data *name)
254
254
return topic ;
255
255
}
256
256
257
- static struct mqtt_sn_topic * mqtt_sn_topic_find_name (struct mqtt_sn_client * client ,
258
- struct mqtt_sn_data * topic_name )
257
+ static struct mqtt_sn_topic * mqtt_sn_topic_find_by_name (struct mqtt_sn_client * client ,
258
+ struct mqtt_sn_data * topic_name )
259
259
{
260
260
struct mqtt_sn_topic * topic ;
261
261
@@ -269,8 +269,8 @@ static struct mqtt_sn_topic *mqtt_sn_topic_find_name(struct mqtt_sn_client *clie
269
269
return NULL ;
270
270
}
271
271
272
- static struct mqtt_sn_topic * mqtt_sn_topic_find_msg_id (struct mqtt_sn_client * client ,
273
- uint16_t msg_id )
272
+ static struct mqtt_sn_topic * mqtt_sn_topic_find_by_msg_id (struct mqtt_sn_client * client ,
273
+ uint16_t msg_id )
274
274
{
275
275
struct mqtt_sn_topic * topic ;
276
276
@@ -288,7 +288,7 @@ static void mqtt_sn_topic_destroy(struct mqtt_sn_client *client, struct mqtt_sn_
288
288
struct mqtt_sn_publish * pub ;
289
289
290
290
/* Destroy all pubs referencing this topic */
291
- while ((pub = mqtt_sn_publish_find_topic (client , topic )) != NULL ) {
291
+ while ((pub = mqtt_sn_publish_find_by_topic (client , topic )) != NULL ) {
292
292
LOG_WRN ("Destroying publish msg_id %d" , pub -> con .msg_id );
293
293
mqtt_sn_publish_destroy (client , pub );
294
294
}
@@ -305,7 +305,7 @@ static void mqtt_sn_topic_destroy_all(struct mqtt_sn_client *client)
305
305
while ((next = sys_slist_get (& client -> topic )) != NULL ) {
306
306
topic = SYS_SLIST_CONTAINER (next , topic , next );
307
307
/* Destroy all pubs referencing this topic */
308
- while ((pub = mqtt_sn_publish_find_topic (client , topic )) != NULL ) {
308
+ while ((pub = mqtt_sn_publish_find_by_topic (client , topic )) != NULL ) {
309
309
LOG_WRN ("Destroying publish msg_id %d" , pub -> con .msg_id );
310
310
mqtt_sn_publish_destroy (client , pub );
311
311
}
@@ -361,7 +361,7 @@ static struct mqtt_sn_gateway *mqtt_sn_gw_create(uint8_t gw_id, short duration,
361
361
return gw ;
362
362
}
363
363
364
- static struct mqtt_sn_gateway * mqtt_sn_gw_find_id (struct mqtt_sn_client * client , uint16_t gw_id )
364
+ static struct mqtt_sn_gateway * mqtt_sn_gw_find_by_id (struct mqtt_sn_client * client , uint16_t gw_id )
365
365
{
366
366
struct mqtt_sn_gateway * gw ;
367
367
@@ -897,7 +897,7 @@ int mqtt_sn_add_gw(struct mqtt_sn_client *client, uint8_t gw_id, struct mqtt_sn_
897
897
{
898
898
struct mqtt_sn_gateway * gw ;
899
899
900
- gw = mqtt_sn_gw_find_id (client , gw_id );
900
+ gw = mqtt_sn_gw_find_by_id (client , gw_id );
901
901
902
902
if (gw != NULL ) {
903
903
mqtt_sn_gw_destroy (client , gw );
@@ -1004,7 +1004,7 @@ int mqtt_sn_subscribe(struct mqtt_sn_client *client, enum mqtt_sn_qos qos,
1004
1004
return - ENOTCONN ;
1005
1005
}
1006
1006
1007
- topic = mqtt_sn_topic_find_name (client , topic_name );
1007
+ topic = mqtt_sn_topic_find_by_name (client , topic_name );
1008
1008
if (!topic ) {
1009
1009
topic = mqtt_sn_topic_create (topic_name );
1010
1010
if (!topic ) {
@@ -1039,7 +1039,7 @@ int mqtt_sn_unsubscribe(struct mqtt_sn_client *client, enum mqtt_sn_qos qos,
1039
1039
return - ENOTCONN ;
1040
1040
}
1041
1041
1042
- topic = mqtt_sn_topic_find_name (client , topic_name );
1042
+ topic = mqtt_sn_topic_find_by_name (client , topic_name );
1043
1043
if (!topic ) {
1044
1044
LOG_HEXDUMP_ERR (topic_name -> data , topic_name -> size , "Topic not found" );
1045
1045
return - ENOENT ;
@@ -1077,7 +1077,7 @@ int mqtt_sn_publish(struct mqtt_sn_client *client, enum mqtt_sn_qos qos,
1077
1077
return - ENOTCONN ;
1078
1078
}
1079
1079
1080
- topic = mqtt_sn_topic_find_name (client , topic_name );
1080
+ topic = mqtt_sn_topic_find_by_name (client , topic_name );
1081
1081
if (!topic ) {
1082
1082
topic = mqtt_sn_topic_create (topic_name );
1083
1083
if (!topic ) {
@@ -1115,7 +1115,7 @@ static void handle_advertise(struct mqtt_sn_client *client, struct mqtt_sn_param
1115
1115
struct mqtt_sn_evt evt = {.type = MQTT_SN_EVT_ADVERTISE };
1116
1116
struct mqtt_sn_gateway * gw ;
1117
1117
1118
- gw = mqtt_sn_gw_find_id (client , p -> gw_id );
1118
+ gw = mqtt_sn_gw_find_by_id (client , p -> gw_id );
1119
1119
1120
1120
if (gw == NULL ) {
1121
1121
LOG_DBG ("Creating GW 0x%02x with duration %d" , p -> gw_id , p -> duration );
@@ -1262,7 +1262,7 @@ static void handle_register(struct mqtt_sn_client *client, struct mqtt_sn_param_
1262
1262
1263
1263
static void handle_regack (struct mqtt_sn_client * client , struct mqtt_sn_param_regack * p )
1264
1264
{
1265
- struct mqtt_sn_topic * topic = mqtt_sn_topic_find_msg_id (client , p -> msg_id );
1265
+ struct mqtt_sn_topic * topic = mqtt_sn_topic_find_by_msg_id (client , p -> msg_id );
1266
1266
1267
1267
if (!topic ) {
1268
1268
LOG_ERR ("Can't REGACK, no topic found" );
@@ -1307,7 +1307,7 @@ static void handle_publish(struct mqtt_sn_client *client, struct mqtt_sn_param_p
1307
1307
1308
1308
static void handle_puback (struct mqtt_sn_client * client , struct mqtt_sn_param_puback * p )
1309
1309
{
1310
- struct mqtt_sn_publish * pub = mqtt_sn_publish_find_msg_id (client , p -> msg_id );
1310
+ struct mqtt_sn_publish * pub = mqtt_sn_publish_find_by_msg_id (client , p -> msg_id );
1311
1311
1312
1312
if (!pub ) {
1313
1313
LOG_ERR ("No matching PUBLISH found for msg id %u" , p -> msg_id );
@@ -1320,7 +1320,7 @@ static void handle_puback(struct mqtt_sn_client *client, struct mqtt_sn_param_pu
1320
1320
static void handle_pubrec (struct mqtt_sn_client * client , struct mqtt_sn_param_pubrec * p )
1321
1321
{
1322
1322
struct mqtt_sn_param response = {.type = MQTT_SN_MSG_TYPE_PUBREL };
1323
- struct mqtt_sn_publish * pub = mqtt_sn_publish_find_msg_id (client , p -> msg_id );
1323
+ struct mqtt_sn_publish * pub = mqtt_sn_publish_find_by_msg_id (client , p -> msg_id );
1324
1324
1325
1325
if (!pub ) {
1326
1326
LOG_ERR ("No matching PUBLISH found for msg id %u" , p -> msg_id );
@@ -1346,7 +1346,7 @@ static void handle_pubrel(struct mqtt_sn_client *client, struct mqtt_sn_param_pu
1346
1346
1347
1347
static void handle_pubcomp (struct mqtt_sn_client * client , struct mqtt_sn_param_pubcomp * p )
1348
1348
{
1349
- struct mqtt_sn_publish * pub = mqtt_sn_publish_find_msg_id (client , p -> msg_id );
1349
+ struct mqtt_sn_publish * pub = mqtt_sn_publish_find_by_msg_id (client , p -> msg_id );
1350
1350
1351
1351
if (!pub ) {
1352
1352
LOG_ERR ("No matching PUBLISH found for msg id %u" , p -> msg_id );
@@ -1358,7 +1358,7 @@ static void handle_pubcomp(struct mqtt_sn_client *client, struct mqtt_sn_param_p
1358
1358
1359
1359
static void handle_suback (struct mqtt_sn_client * client , struct mqtt_sn_param_suback * p )
1360
1360
{
1361
- struct mqtt_sn_topic * topic = mqtt_sn_topic_find_msg_id (client , p -> msg_id );
1361
+ struct mqtt_sn_topic * topic = mqtt_sn_topic_find_by_msg_id (client , p -> msg_id );
1362
1362
1363
1363
if (!topic ) {
1364
1364
LOG_ERR ("No matching SUBSCRIBE found for msg id %u" , p -> msg_id );
@@ -1376,7 +1376,7 @@ static void handle_suback(struct mqtt_sn_client *client, struct mqtt_sn_param_su
1376
1376
1377
1377
static void handle_unsuback (struct mqtt_sn_client * client , struct mqtt_sn_param_unsuback * p )
1378
1378
{
1379
- struct mqtt_sn_topic * topic = mqtt_sn_topic_find_msg_id (client , p -> msg_id );
1379
+ struct mqtt_sn_topic * topic = mqtt_sn_topic_find_by_msg_id (client , p -> msg_id );
1380
1380
1381
1381
if (!topic || topic -> state != MQTT_SN_TOPIC_STATE_UNSUBSCRIBING ) {
1382
1382
LOG_ERR ("No matching UNSUBSCRIBE found for msg id %u" , p -> msg_id );
0 commit comments