b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame^] | 1 | #ifndef __MMP_ONKEY__ |
| 2 | #define __MMP_ONKEY__ |
| 3 | |
| 4 | #include <stdio.h> |
| 5 | #include<stdlib.h> |
| 6 | #include<string.h> |
| 7 | #include <unistd.h> |
| 8 | #include <sys/types.h> |
| 9 | #include <sys/select.h> |
| 10 | #include <errno.h> |
| 11 | #include <sys/stat.h> |
| 12 | #include <fcntl.h> |
| 13 | #include <sys/socket.h> |
| 14 | #include <arpa/inet.h> |
| 15 | #include <libubus.h> |
| 16 | #include <libubox/blob.h> |
| 17 | #include <libubox/usock.h> |
| 18 | #include <uci.h> |
| 19 | #include <cutils/properties.h> |
| 20 | #include <ril.h> |
| 21 | #include <rilutil.h> |
| 22 | #include <time.h> |
| 23 | |
| 24 | #define RildName "ril" |
| 25 | |
| 26 | enum { |
| 27 | ONKEY_CALL, |
| 28 | __ONKEY_MAX |
| 29 | }; |
| 30 | |
| 31 | #define RIL_MAX_RETRIES 20 |
| 32 | |
| 33 | static const struct blobmsg_policy onkey_policy[] = { |
| 34 | [ONKEY_CALL] = { .name = "onkey", .type = BLOBMSG_TYPE_INT32 }, |
| 35 | }; |
| 36 | |
| 37 | int onkey_method(struct ubus_context *ctx, struct ubus_object *obj, |
| 38 | struct ubus_request_data *req, const char *method, |
| 39 | struct blob_attr *msg); |
| 40 | void complete_radio_power_async_cb(struct ubus_request *req, int ret); |
| 41 | int onkey_init(struct ubus_context *ctx); |
| 42 | void poweroff_system(int sec); |
| 43 | |
| 44 | #endif |