Skip to content

Commit dc4acf0

Browse files
authored
[coap] use otError in C handlers (openthread#11115)
This commit changes CoAP handlers to use otError in the function or method definitions. This ensures the definitions are consistent with the declaration in coap.h.
1 parent f3dded4 commit dc4acf0

26 files changed

+44
-38
lines changed

src/core/meshcop/border_agent.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ Error BorderAgent::ForwardToLeader(const Coap::Message &aMessage, const Ip6::Mes
372372
void BorderAgent::HandleCoapResponse(void *aContext,
373373
otMessage *aMessage,
374374
const otMessageInfo *aMessageInfo,
375-
Error aResult)
375+
otError aResult)
376376
{
377377
OT_UNUSED_VARIABLE(aMessageInfo);
378378

src/core/meshcop/border_agent.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ class BorderAgent : public InstanceLocator, private NonCopyable
305305
static void HandleCoapResponse(void *aContext,
306306
otMessage *aMessage,
307307
const otMessageInfo *aMessageInfo,
308-
Error aResult);
308+
otError aResult);
309309
void HandleCoapResponse(const ForwardContext &aForwardContext, const Coap::Message *aResponse, Error aResult);
310310
static bool HandleUdpReceive(void *aContext, const otMessage *aMessage, const otMessageInfo *aMessageInfo);
311311
bool HandleUdpReceive(const Message &aMessage, const Ip6::MessageInfo &aMessageInfo);

src/core/meshcop/commissioner.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ Error Commissioner::SendMgmtCommissionerGetRequest(const uint8_t *aTlvs, uint8_t
633633
void Commissioner::HandleMgmtCommissionerGetResponse(void *aContext,
634634
otMessage *aMessage,
635635
const otMessageInfo *aMessageInfo,
636-
Error aResult)
636+
otError aResult)
637637
{
638638
static_cast<Commissioner *>(aContext)->HandleMgmtCommissionerGetResponse(AsCoapMessagePtr(aMessage),
639639
AsCoreTypePtr(aMessageInfo), aResult);
@@ -704,7 +704,7 @@ Error Commissioner::SendMgmtCommissionerSetRequest(const CommissioningDataset &a
704704
void Commissioner::HandleMgmtCommissionerSetResponse(void *aContext,
705705
otMessage *aMessage,
706706
const otMessageInfo *aMessageInfo,
707-
Error aResult)
707+
otError aResult)
708708
{
709709
static_cast<Commissioner *>(aContext)->HandleMgmtCommissionerSetResponse(AsCoapMessagePtr(aMessage),
710710
AsCoreTypePtr(aMessageInfo), aResult);
@@ -757,7 +757,7 @@ Error Commissioner::SendPetition(void)
757757
void Commissioner::HandleLeaderPetitionResponse(void *aContext,
758758
otMessage *aMessage,
759759
const otMessageInfo *aMessageInfo,
760-
Error aResult)
760+
otError aResult)
761761
{
762762
static_cast<Commissioner *>(aContext)->HandleLeaderPetitionResponse(AsCoapMessagePtr(aMessage),
763763
AsCoreTypePtr(aMessageInfo), aResult);
@@ -844,7 +844,7 @@ void Commissioner::SendKeepAlive(uint16_t aSessionId)
844844
void Commissioner::HandleLeaderKeepAliveResponse(void *aContext,
845845
otMessage *aMessage,
846846
const otMessageInfo *aMessageInfo,
847-
Error aResult)
847+
otError aResult)
848848
{
849849
static_cast<Commissioner *>(aContext)->HandleLeaderKeepAliveResponse(AsCoapMessagePtr(aMessage),
850850
AsCoreTypePtr(aMessageInfo), aResult);

src/core/meshcop/commissioner.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -396,22 +396,22 @@ class Commissioner : public InstanceLocator, private NonCopyable
396396
static void HandleMgmtCommissionerSetResponse(void *aContext,
397397
otMessage *aMessage,
398398
const otMessageInfo *aMessageInfo,
399-
Error aResult);
399+
otError aResult);
400400
void HandleMgmtCommissionerSetResponse(Coap::Message *aMessage,
401401
const Ip6::MessageInfo *aMessageInfo,
402402
Error aResult);
403403
static void HandleMgmtCommissionerGetResponse(void *aContext,
404404
otMessage *aMessage,
405405
const otMessageInfo *aMessageInfo,
406-
Error aResult);
406+
otError aResult);
407407
void HandleMgmtCommissionerGetResponse(Coap::Message *aMessage,
408408
const Ip6::MessageInfo *aMessageInfo,
409409
Error aResult);
410410
static void HandleLeaderPetitionResponse(void *aContext,
411411
otMessage *aMessage,
412412
const otMessageInfo *aMessageInfo,
413-
Error aResult);
414-
void HandleLeaderPetitionResponse(Coap::Message *aMessage, const Ip6::MessageInfo *aMessageInfo, Error aResult);
413+
otError aResult);
414+
void HandleLeaderPetitionResponse(Coap::Message *aMessage, const Ip6::MessageInfo *aMessageInfo, otError aResult);
415415
static void HandleLeaderKeepAliveResponse(void *aContext,
416416
otMessage *aMessage,
417417
const otMessageInfo *aMessageInfo,

src/core/meshcop/dataset_manager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ Error DatasetManager::SendSetRequest(const Dataset &aDataset)
498498
void DatasetManager::HandleMgmtSetResponse(void *aContext,
499499
otMessage *aMessage,
500500
const otMessageInfo *aMessageInfo,
501-
Error aError)
501+
otError aError)
502502
{
503503
static_cast<DatasetManager *>(aContext)->HandleMgmtSetResponse(AsCoapMessagePtr(aMessage),
504504
AsCoreTypePtr(aMessageInfo), aError);

src/core/meshcop/dataset_manager.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ class DatasetManager : public InstanceLocator
291291
static void HandleMgmtSetResponse(void *aContext,
292292
otMessage *aMessage,
293293
const otMessageInfo *aMessageInfo,
294-
Error aError);
294+
otError aError);
295295

296296
#if OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE
297297
void MoveKeysToSecureStorage(Dataset &aDataset) const;

src/core/meshcop/joiner.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ void Joiner::SendJoinerFinalize(void)
470470
void Joiner::HandleJoinerFinalizeResponse(void *aContext,
471471
otMessage *aMessage,
472472
const otMessageInfo *aMessageInfo,
473-
Error aResult)
473+
otError aResult)
474474
{
475475
static_cast<Joiner *>(aContext)->HandleJoinerFinalizeResponse(AsCoapMessagePtr(aMessage), &AsCoreType(aMessageInfo),
476476
aResult);

src/core/meshcop/joiner.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ class Joiner : public InstanceLocator, private NonCopyable
199199
static void HandleJoinerFinalizeResponse(void *aContext,
200200
otMessage *aMessage,
201201
const otMessageInfo *aMessageInfo,
202-
Error aResult);
202+
otError aResult);
203203
void HandleJoinerFinalizeResponse(Coap::Message *aMessage, const Ip6::MessageInfo *aMessageInfo, Error aResult);
204204

205205
template <Uri kUri> void HandleTmf(Coap::Message &aMessage, const Ip6::MessageInfo &aMessageInfo);

src/core/meshcop/joiner_router.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ Coap::Message *JoinerRouter::PrepareJoinerEntrustMessage(void)
309309
void JoinerRouter::HandleJoinerEntrustResponse(void *aContext,
310310
otMessage *aMessage,
311311
const otMessageInfo *aMessageInfo,
312-
Error aResult)
312+
otError aResult)
313313
{
314314
static_cast<JoinerRouter *>(aContext)->HandleJoinerEntrustResponse(AsCoapMessagePtr(aMessage),
315315
AsCoreTypePtr(aMessageInfo), aResult);

src/core/meshcop/joiner_router.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class JoinerRouter : public InstanceLocator, private NonCopyable
101101
static void HandleJoinerEntrustResponse(void *aContext,
102102
otMessage *aMessage,
103103
const otMessageInfo *aMessageInfo,
104-
Error aResult);
104+
otError aResult);
105105
void HandleJoinerEntrustResponse(Coap::Message *aMessage, const Ip6::MessageInfo *aMessageInfo, Error aResult);
106106

107107
void HandleTimer(void);

0 commit comments

Comments
 (0)