Syntax
int SetDefault(
const unsigned int com_port
);
Parameters
- com_port
-
[in] Specify the port number for configuration settings.
Value Description COM3 Bluetooth SPP (Master) COM4 Bluetooth HID (Slave) COM5 Bluetooth SPP (Slave)
Return value
The function returns a successful setting (OK) or a failure (ERROR).
Value | Description |
---|---|
OK | Setting succeeded. |
ERROR | Setting failed. |
Remarks
Check the GetErrorStatus function for details on errors.
Also, make sure that the port is closed when using this function.
See the setconfig_comapi structure for the data structures.
Also, make sure that the port is closed when using this function.
See the setconfig_comapi structure for the data structures.
Requirements
Header file:
lib.hLibrary file:
libSTARTUPOPH5000.a
Sample
#include <stdio.h>
#include "lib.h"
void main( void )
{
int ch;
setconfig_comapi config;
SetDefault( COM5 );
GetConfig( COM5, (void *)&config );
config.blt.encryption = 1;
SetConfig( COM5, (void *)&config );
ComOpen( COM5 ); // Open the COM port
for(;;)
{
if( (ch = GetCom( 0 )) != -1)
{
putchar( ch );
PutCom( ch );
}
if( (ch = getchar()) != EOF)
{
putchar( ch );
PutCom( ch );
}
Idle(); // Very important to lower the power consumption
}
}
Last updated: 2020/10/07