fix: 暂存

This commit is contained in:
wangzhongjie 2025-03-05 11:22:14 +08:00
parent 32e66a83be
commit 097711c46c

View File

@ -3,6 +3,7 @@ import util from '@ohos.util'
import promptAction from '@ohos.promptAction' import promptAction from '@ohos.promptAction'
import TcpToByte from './utils/tcp2byte' import TcpToByte from './utils/tcp2byte'
import { bytesToDecimal } from './utils/tools' import { bytesToDecimal } from './utils/tools'
const TAG = '[TCP2BYTE]' const TAG = '[TCP2BYTE]'
@ -12,8 +13,8 @@ interface RES {
} }
const config = { const config = {
address: '114.55.125.222', address: '172.37.55.191',
port: 50189 port: 40000
} }
export default async function tcp2ByteRequest(data): Promise<RES> { export default async function tcp2ByteRequest(data): Promise<RES> {
@ -27,7 +28,11 @@ export default async function tcp2ByteRequest(data): Promise<RES> {
console.info(TAG, 'sendData=>' + JSON.stringify(sendData)) console.info(TAG, 'sendData=>' + JSON.stringify(sendData))
try { try {
await tcpClient.connect({address: {address, port}}) await tcpClient.connect({
address: {
address, port
}
})
//发送消息 //发送消息
handSendMessage(tcpClient, data.sjbs, sendData) handSendMessage(tcpClient, data.sjbs, sendData)
} catch (e) { } catch (e) {
@ -83,7 +88,8 @@ function handSendMessage(client: socket.TCPSocket, type, data) {
client.send({ data: new Uint8Array(data).buffer }) client.send({ data: new Uint8Array(data).buffer })
break; break;
default:break; default:
break;
} }
} }