| | |
| | | private static final ZoneId DEVICE_ZONE = ZoneId.of("Asia/Hong_Kong"); |
| | | private static final DateTimeFormatter DEVICE_TIME = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS"); |
| | | |
| | | /** 返回固定的适配器实例代码,用于把模拟观测归属到 dev-sim 这一实例。 */ |
| | | @Override |
| | | public String adapterCode() |
| | | { |
| | | return ADAPTER_CODE; |
| | | } |
| | | |
| | | /** 返回只观测能力:支持发现与实时观测,不支持历史下载,也不支持向设备下发控制命令。 */ |
| | | @Override |
| | | public AdapterCapabilities capabilities() |
| | | { |
| | |
| | | simulator = ScriptedBtsTcpSimulator.responding(port, this::respond); |
| | | } |
| | | |
| | | /** 返回模拟器 TCP 端点实际监听的端口。 */ |
| | | public int port() |
| | | { |
| | | return simulator.port(); |
| | |
| | | throw new IllegalStateException("Invalid BTS simulator numbering or tombstone state in Redis"); |
| | | } |
| | | |
| | | /** 停止模拟器:标记为不再运行并释放 TCP 端点;释放失败时以运行时异常报告。 */ |
| | | @Override |
| | | public synchronized void close() |
| | | { |