John Bailey / XBeeApi

Dependencies:   CircularBuffer FixedLengthList

Dependents:   XBeeApiTest XBeeApiSimpleATCmdsExample XBeeApiBroadcastExample XBeeApiBroadcastExampleRTOS ... more

Utility/XBeeApiSetupHelper.cpp

Committer:
johnb
Date:
2014-08-08
Revision:
56:7fe74b03e6b1
Parent:
46:a1abbc66f157

File content as of revision 56:7fe74b03e6b1:

/** 

Copyright 2014 John Bailey
   
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

*/

#include "XBeeApiSetupHelper.hpp"

bool xbeeSetNetworkTypeP2P( XBeeApiCmdAt* const p_xbeeCmd,
                            const XBeeApiCmdAt::panId_t p_id,
                            const XBeeApiCmdAt::channel_t p_chan )
{    
    bool ret_val = p_xbeeCmd->setCoordinatorEnabled( false );
    if( ret_val ) 
    {
        ret_val = p_xbeeCmd->setEndDeviceAssociationEnabled( false );
    }
    if( ret_val ) 
    {
        p_xbeeCmd->setChannel( p_chan );
    }
    if( ret_val ) 
    {
        p_xbeeCmd->setPanId( p_id );
    }
    return ret_val;
}