| 12345678910111213141516171819202122232425262728 |
- package main
- import (
- "context"
- "strconv"
- "hnyfkj.com.cn/rtu/linux/netmgrd"
- "hnyfkj.com.cn/rtu/linux/utils/jsonrpc2"
- )
- func getModemInfo(ctx context.Context, req *jsonrpc2.Request) *jsonrpc2.Response {
- result := map[string]string{
- "imei": netmgrd.GetIMEI(),
- "iccid": netmgrd.GetSimICCID(),
- "rssi": netmgrd.GetRSSI(),
- }
- return jsonrpc2.BuildResponse(req, result, nil)
- }
- func getNetStatus(ctx context.Context, req *jsonrpc2.Request) *jsonrpc2.Response {
- result := map[string]string{
- "net_ok": strconv.FormatBool(netmgrd.IsInetAvailable()),
- "net_type": netmgrd.GetCurrentNetType().String(),
- }
- return jsonrpc2.BuildResponse(req, result, nil)
- }
|