23
23
#include < json/json.h>
24
24
#include < lib/core/DataModelTypes.h>
25
25
26
- using namespace std ;
27
26
using namespace chip ::app::Clusters;
28
27
using namespace chip ::app::Clusters::AccountLogin;
29
28
using Status = chip::Protocols::InteractionModel::Status;
30
29
31
30
namespace {
32
31
33
32
const auto loginTempAccountIdentifierFieldId =
34
- to_string (chip::to_underlying(AccountLogin::Commands::Login::Fields::kTempAccountIdentifier ));
35
- const auto loginSetupPINFieldId = to_string(chip::to_underlying(AccountLogin::Commands::Login::Fields::kSetupPIN ));
36
- const auto loginNodeFieldId = to_string(chip::to_underlying(AccountLogin::Commands::Login::Fields::kNode ));
37
- const auto logoutNodeFieldId = to_string(chip::to_underlying(AccountLogin::Commands::Logout::Fields::kNode ));
33
+ std:: to_string (chip::to_underlying(AccountLogin::Commands::Login::Fields::kTempAccountIdentifier ));
34
+ const auto loginSetupPINFieldId = std:: to_string(chip::to_underlying(AccountLogin::Commands::Login::Fields::kSetupPIN ));
35
+ const auto loginNodeFieldId = std:: to_string(chip::to_underlying(AccountLogin::Commands::Login::Fields::kNode ));
36
+ const auto logoutNodeFieldId = std:: to_string(chip::to_underlying(AccountLogin::Commands::Logout::Fields::kNode ));
38
37
39
- string charSpanToString (const CharSpan & charSpan)
38
+ std:: string charSpanToString (const CharSpan & charSpan)
40
39
{
41
40
return { charSpan.data (), charSpan.size () };
42
41
}
@@ -45,12 +44,12 @@ std::string serializeLoginCommand(AccountLogin::Commands::Login::Type cmd)
45
44
{
46
45
return R"( {")" + loginTempAccountIdentifierFieldId + R"( ":")" + charSpanToString (cmd.tempAccountIdentifier ) + R"( ",)" + R"( ")" +
47
46
loginSetupPINFieldId + R"( ":")" + charSpanToString (cmd.setupPIN ) + R"( ",)" + R"( ")" + loginNodeFieldId + R"( ":")" +
48
- to_string (cmd.node .Value ()) + R"( "})" ;
47
+ std:: to_string (cmd.node .Value ()) + R"( "})" ;
49
48
}
50
49
51
50
std::string serializeLogoutCommand (AccountLogin::Commands::Logout::Type cmd)
52
51
{
53
- return R"( {")" + logoutNodeFieldId + R"( ":")" + to_string (cmd.node .Value ()) + R"( "})" ;
52
+ return R"( {")" + logoutNodeFieldId + R"( ":")" + std:: to_string (cmd.node .Value ()) + R"( "})" ;
54
53
}
55
54
56
55
} // namespace
@@ -128,7 +127,7 @@ bool AccountLoginManager::HandleLogout(const chip::Optional<chip::NodeId> & node
128
127
void AccountLoginManager::HandleGetSetupPin (CommandResponseHelper<GetSetupPINResponse> & helper,
129
128
const CharSpan & tempAccountIdentifier)
130
129
{
131
- string tempAccountIdentifierString (tempAccountIdentifier.data (), tempAccountIdentifier.size ());
130
+ std:: string tempAccountIdentifierString (tempAccountIdentifier.data (), tempAccountIdentifier.size ());
132
131
133
132
GetSetupPINResponse response;
134
133
ChipLogProgress (Zcl, " temporary account id: %s returning pin: %s" , tempAccountIdentifierString.c_str (), mSetupPin );
@@ -144,7 +143,7 @@ void AccountLoginManager::GetSetupPin(char * setupPin, size_t setupPinSize, cons
144
143
// Other methods in this class do not need to be changed beecause those will get routed to java layer
145
144
// upstream.
146
145
ChipLogProgress (DeviceLayer, " AccountLoginManager::GetSetupPin called for endpoint %d" , mEndpointId );
147
- string tempAccountIdentifierString (tempAccountIdentifier.data (), tempAccountIdentifier.size ());
146
+ std:: string tempAccountIdentifierString (tempAccountIdentifier.data (), tempAccountIdentifier.size ());
148
147
if (mCommandDelegate == nullptr )
149
148
{
150
149
// For the dummy content apps to work.
0 commit comments