| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- import Aedes from 'aedes';
- interface BrokerClient {
- id: string;
- username?: string;
- ip?: string;
- port?: number;
- connectedAt?: Date;
- }
- export declare class MqttBrokerService {
- private static instance;
- private broker;
- private server;
- private port;
- private connectedClients;
- private syncInterval;
- private constructor();
- static getInstance(): MqttBrokerService;
- start(): Promise<void>;
- stop(): Promise<void>;
- private setupBrokerEvents;
- private authenticateClient;
- private authorizePublish;
- private authorizeSubscribe;
- private isSuperuser;
- private checkAclPermission;
- private topicMatches;
- private getClientIp;
- private handleClientConnect;
- private handleClientDisconnect;
- private handleMessagePublish;
- private handleClientSubscribe;
- private handleClientUnsubscribe;
- private handleDeviceMessage;
- private handleOtaMessage;
- private handleRelayStateMessage;
- private handleRssiMessage;
- private handleWifiInfoMessage;
- private handleWifiStatusMessage;
- private handleSensorData;
- publishOtaCommand(taskId: number): Promise<void>;
- private executePendingOTATasks;
- private startDeviceStatusSync;
- getConnectedClients(): BrokerClient[];
- getConnectedClientCount(): number;
- getBroker(): InstanceType<typeof Aedes>;
- disconnectClient(clientId: string): boolean;
- publish(topic: string, payload: string | Buffer, options?: {
- qos?: number;
- retain?: boolean;
- }): Promise<void>;
- private detectPayloadFormat;
- private logAuth;
- private broadcastToWebSocket;
- }
- export {};
- //# sourceMappingURL=mqttBrokerService.d.ts.map
|