-
Notifications
You must be signed in to change notification settings - Fork 1
/
libqril_services.h
69 lines (59 loc) · 1.54 KB
/
libqril_services.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#ifndef __LIBQRIL_SERVICES_H__
#define __LIBQRIL_SERVICES_H__
#include "libqrtr.h"
#include "libqril_qmi.h"
#include "list.h"
/**
* @brief init services local state. Must be called
* before \a messages_init()
*/
void services_init();
/**
* @brief get the port and node for a QMI service
*
* @type: The QMI service to get
* @port: Port result
* @node: Node result
*
* @returns 0 if the service is online, -ENOENT otherwise
*/
int qmi_service_get(enum qmi_service type, int *port, int *node);
/**
* @brief get the port for an online QMI service
*
* @type: The QMI service to lookup (e.g. QMI_SERVICE_UIM)
*
* @returns positive port on success, -ENOENT otherwise
*/
int qmi_service_get_port(enum qmi_service type);
/**
* @brief get the node providing a QMI service
*
* @type: The QMI service to lookup
*
* @returns the node (e.g. 0 is modem) or -ENOENT
* if the service is unavailable
*/
int qmi_service_get_node(enum qmi_service type);
/**
* @brief get a service by port
*
* @port: The port the service is on
* @type: Service type to return
*
* @returns 0 on success, -ENOENT if the service is offline
*/
int qmi_service_from_port(uint16_t port, enum qmi_service *type);
/**
* @brief register a new service, called from message thread
*
* @pkt: A qrtr_packet of type QRTR_TYPE_NEW_SERVER
*/
void qmi_service_new(struct qrtr_packet *pkt);
/**
* @brief notify of a service going offline, called from message thread
*
* @pkt: A qrtr_packet of type QRTR_TYPE_DEL_SERVER
*/
void qmi_service_goodbye(enum qmi_service type);
#endif