Device Function

Listen

dev_Listen()

Listen on all layers in the device.

Syntax
#include "device.h"

LResult  dev_Listen
    (
         LDevice  device
    );
devicedevice to listen on
Description

dev_Listen() puts all layers in the device into listening state from the top down. After a successful call to dev_Listen(), the application can call dev_ListenCheck() to find out if the device has received a connect request.

Return Values

If successful, dev_Listen() returns a non-negative value. Otherwise, it returns a negative value indicating the reason it failed. Possible unsuccessful return values are:

See Also

dev_ListenCheck()

Example
if ((result = dev_Open(device)) < 0)
{
    LOG("Open failure", dev_ErrorMessage(result));
}
else
{
    if ((result = dev_Listen(device)) < 0)
    {
        LOG("Listen failure", dev_ErrorMessage(result));
    }
}