Exemplo n.º 1
0
/*
 * Function obex_transport_accept(self)
 *
 *    Accept an incoming connection.
 *
 */
static int obex_transport_accept(obex_t *self)
{
	int ret = -1;

	DEBUG(4, "\n");

	switch (self->trans.type) {
#ifdef HAVE_IRDA
	case OBEX_TRANS_IRDA:
		ret = irobex_accept(self);
		break;
#endif /*HAVE_IRDA*/
	case OBEX_TRANS_INET:
		ret = inobex_accept(self);
		break;
#ifdef HAVE_BLUETOOTH
	case OBEX_TRANS_BLUETOOTH:
		ret = btobex_accept(self);
		break;
#endif /*HAVE_BLUETOOTH*/
	case OBEX_TRANS_FD:
		/* no real accept on a file */
		ret = 0;
		break;

	default:
		DEBUG(4, "domain not implemented!\n");
		break;
	}

	return ret;
}
Exemplo n.º 2
0
int main(int argc, char **argv)
{
    obex_object_t *object;

    handle = OBEX_Init(OBEX_TRANS_BLUETOOTH, obex_event, 0);

    if (argc == 1)
    {
        BtOBEX_ServerRegister(handle, NULL, OBEX_PUSH_HANDLE);
        printf("Waiting for connection...\n");
        btobex_accept(handle);

        while (!finished)
            OBEX_HandleInput(handle, 1);
    }
}