b.liu | f678f99 | 2024-05-08 15:23:10 +0800 | [diff] [blame] | 1 | #include "mbtk_type.h" |
b.liu | bb5e768 | 2024-02-28 20:13:04 +0800 | [diff] [blame] | 2 | #include "mbtk_device.h" |
| 3 | |
| 4 | static char* band_2_str(mbtk_modem_band_area_enum band_area) |
| 5 | { |
| 6 | switch(band_area) |
| 7 | { |
| 8 | case MBTK_MODEM_BAND_AREA_CN: |
| 9 | return "CN"; |
| 10 | case MBTK_MODEM_BAND_AREA_EU: |
| 11 | return "EU"; |
| 12 | default: |
| 13 | return "ALL"; |
| 14 | } |
| 15 | } |
| 16 | |
| 17 | int main(int argc, char *argv[]) |
| 18 | { |
| 19 | mbtk_device_info_basic_t info_basic; |
| 20 | memset(&info_basic, 0, sizeof(mbtk_device_info_basic_t)); |
| 21 | int result = mbtk_dev_info_read(MBTK_DEVICE_INFO_ITEM_BASIC, &info_basic, sizeof(mbtk_device_info_basic_t)); |
| 22 | if(result) { |
| 23 | printf("mbtk_dev_info_read(BASIC) fail.\n"); |
| 24 | return -1; |
| 25 | } |
| 26 | |
| 27 | /* |
| 28 | uint8 project[16]; // T108 / L508_X6 |
| 29 | uint8 project_cust[16]; // T108_C1 / L508_X6_C1 (Refer to: Custom_Model in blf file.) |
| 30 | uint32 ab_support; // 1 for ab |
| 31 | uint8 revision_out[48]; // L508_X6v01.01b04.00 |
| 32 | uint8 revision_in[64]; |
| 33 | */ |
| 34 | printf("Project:%s\n", info_basic.project); |
| 35 | printf("Custom_Model:%s\n", info_basic.project_cust); |
| 36 | printf("Revision_Out:%s\n", info_basic.revision_out); |
| 37 | printf("Revision_In:%s\n", info_basic.revision_in); |
| 38 | printf("AB System:%s\n", info_basic.ab_support ? "Yes" : "No"); |
b.liu | f678f99 | 2024-05-08 15:23:10 +0800 | [diff] [blame] | 39 | printf("Reboot flag:%d\n", info_basic.reboot_flag); |
b.liu | bb5e768 | 2024-02-28 20:13:04 +0800 | [diff] [blame] | 40 | |
| 41 | mbtk_device_info_modem_t info_modem; |
| 42 | memset(&info_modem, 0, sizeof(mbtk_device_info_modem_t)); |
| 43 | result = mbtk_dev_info_read(MBTK_DEVICE_INFO_ITEM_MODEM, &info_modem, sizeof(mbtk_device_info_modem_t)); |
| 44 | if(result) { |
| 45 | printf("mbtk_dev_info_read(MODEM) fail.\n"); |
| 46 | return -1; |
| 47 | } |
| 48 | |
| 49 | printf("Band:%s\n", band_2_str(info_modem.band_area)); |
| 50 | printf("Band GSM:0x%08x\n", info_modem.band_gsm); |
| 51 | printf("Band WCDMA:0x%08x\n", info_modem.band_wcdma); |
| 52 | printf("Band TDLTE:0x%08x\n", info_modem.band_tdlte); |
| 53 | printf("Band FDDLTE:0x%08x\n", info_modem.band_fddlte); |
| 54 | |
| 55 | return 0; |
| 56 | } |
| 57 | |
| 58 | |