Files
ruvnet--RuView/ui/mobile/src/services/rssi.service.ts
T
ruv fdc7142dfa feat: Implement RSSI service for iOS and Web platforms
- Added IosRssiService to handle synthetic RSSI data for iOS.
- Created WebRssiService to simulate RSSI scanning on the web.
- Defined shared types for WifiNetwork and RssiService in rssi.service.ts.
- Introduced simulation service to generate synthetic sensing data.
- Implemented WebSocket service for real-time data handling with reconnection logic.
- Established Zustand stores for managing application state related to MAT and pose data.
- Developed theme context and utility functions for consistent styling and formatting.
- Added type definitions for various application entities including API responses and sensing data.
- Created utility functions for color mapping and URL validation.
- Configured TypeScript settings for the mobile application.
2026-03-02 10:30:33 -05:00

34 lines
1000 B
TypeScript

export interface WifiNetwork {
ssid: string;
bssid?: string;
level: number;
}
export interface RssiService {
startScanning(intervalMs: number): void;
stopScanning(): void;
subscribe(listener: (networks: WifiNetwork[]) => void): () => void;
}
// Metro resolves the correct platform file automatically:
// rssi.service.android.ts (Android)
// rssi.service.ios.ts (iOS)
// rssi.service.web.ts (Web)
// This file only exports the shared types.
// The platform entry is re-exported from the index barrel below.
import { Platform } from 'react-native';
// Lazy require to avoid bundling native modules on web
function getPlatformService(): RssiService {
if (Platform.OS === 'android') {
return require('./rssi.service.android').rssiService;
} else if (Platform.OS === 'ios') {
return require('./rssi.service.ios').rssiService;
} else {
return require('./rssi.service.web').rssiService;
}
}
export const rssiService: RssiService = getPlatformService();