पैकेज, रिपॉज़िटरी और ऐप श्रेणियाँ खोजें

पैकेज विवरणv0.2.8

flutter_serial_communication

सीरियल संचार के लिए लाइब्रेरी। वर्तमान में Android USB (OTG) का समर्थन करता है जो Android पर Arduino और अन्य USB सीरियल हार्डवेयर के साथ संचार करता है, बिना रूट एक्सेस के।

Android
30-दिन डाउनलोड
2.1 हज़ार
लाइक
32
Pub अंक
160

पैकेज इंस्टॉल करें

flutter pub add flutter_serial_communication

पैकेज अवलोकन

सार्वजनिक जानकारी से बना चयन मार्गदर्शन। केवल संदर्भ हेतु।

एक फ्लटर पैकेज जो यूएसबी ओटीजी के माध्यम से एंड्रॉइड डिवाइस पर सीरियल संचार की अनुमति देता है, जिससे आर्डिनो और अन्य यूएसबी सीरियल हार्डवेयर के साथ बातचीत करने में सक्षम होता है बिना रूट एक्सेस के। यह एंड्रॉइड के यूएसबी होस्ट एपीआई का उपयोग करके डेटा आदान-प्रदान के लिए भरोसेमंद कनेक्शन स्थापित करता है। यह लाइब्रेरी ऐसे डेवलपर्स के लिए डिज़ाइन की गई है जो सीरियल प्रोटोकॉल के माध्यम से बाहरी हार्डवेयर से जुड़े ऐप्स बनाते हैं, जैसे सेंसर या माइक्रोकंट्रोलर। यह एंड्रॉइड पर फ्लटर ऐप्स में सीरियल पोर्ट के सेटअप और हैंडलिंग को सरल बनाता है।

उपयोग

  • USB OTG के माध्यम से Arduino से जुड़ना
  • बाहरी हार्डवेयर से सेंसर डेटा पढ़ना
  • सीरियल प्रोटोकॉल के माध्यम से आईओटी डिवाइस का नियंत्रण
  • औद्योगिक या प्रयोगशाला स्वचालन एप्लिकेशन विकसित करना
  • एम्बेडेड सिस्टम के लिए मोबाइल इंटरफेस बनाना

मुख्य विशेषताएँ

  • Android पर USB OTG समर्थन
  • मूल एक्सेस की आवश्यकता नहीं है
  • सीरियल पोर्ट प्रबंधन के लिए सरल API
  • वास्तविक समय डेटा प्रवाह
  • क्रॉस-प्लेटफॉर्म संगत (Android के लिए केवल)
  • एम्बेडेड त्रुटि हैंडलिंग

इनके लिए उपयुक्त

  • आईओटी ऐप विकासकर्ता
  • हार्डवेयर इंटरफेसिंग प्रोजेक्ट्स
  • शैक्षिक रोबोटिक्स
  • एम्बेडेड सिस्टम नियंत्रण एप्प्स
  • Android-केवल सीरियल संचार की आवश्यकता

विचार योग्य बातें

  • Android प्लेटफॉर्म तक सीमित
  • USB OTG हार्डवेयर की आवश्यकता है
  • अनुमति प्रबंधन की आवश्यकता हो सकती है
  • उपकरण-विशिष्ट USB सुसंगतता
  • iOS या डेस्कटॉप के लिए उपयुक्त नहीं

मूल README

संबंधित सोर्स रिपॉज़िटरी के मूल README का स्नैपशॉट। नवीनतम सामग्री के लिए रिपॉज़िटरी देखें।

About Flutter Serial Communication

This library aims to ease Flutter Developers to do serial communcation with their peripherals without too much hassle.

Currently supports Android USB (OTG) to communicate with Arduinos and other USB serial hardware on Android WITHOUT using root access.

Installing

1. Install it to your flutter project

flutter pub add flutter_serial_communication

or by adding dependencies to your package's pubspec.yaml then run dart pub get

dependencies:
  flutter_serial_communication: 0.2.8

2. Import it in your .dart file

import 'package:flutter_serial_communication/flutter_serial_communication.dart';

Features

  • Doesn't require root in Android
  • Easy to use
  • Using listener for reading message & device connection status

Functions

  • Get All Available Devices:
final _flutterSerialCommunicationPlugin = FlutterSerialCommunication();

List<DeviceInfo> availableDevices = await _flutterSerialCommunicationPlugin.getAvailableDevices();
  • Connect:
final _flutterSerialCommunicationPlugin = FlutterSerialCommunication();

DeviceInfo device = DeviceInfo(); // DeviceInfo from getAvailableDevices()
int baudRate = 0; // Your device's baud rate
bool isConnectionSuccess = await _flutterSerialCommunicationPlugin.connect(device, baudRate);
  • Disconnect:
final _flutterSerialCommunicationPlugin = FlutterSerialCommunication();

await _flutterSerialCommunicationPlugin.disconnect();
  • Write:
final _flutterSerialCommunicationPlugin = FlutterSerialCommunication();

bool isMessageSent = await _flutterSerialCommunicationPlugin.write(Uint8List.fromList([0xBB, 0x00, 0x22, 0x00, 0x00, 0x22, 0x7E]));
debugPrint("Is Message Sent:  $isMessageSent");
  • Read (Listener):
final _flutterSerialCommunicationPlugin = FlutterSerialCommunication();

EventChannel eventChannel = _flutterSerialCommunicationPlugin.getSerialMessageListener();
eventChannel.receiveBroadcastStream().listen((event) {
  debugPrint("Received From Native:  $event");
});
  • Device Connection Status (Listener):
final _flutterSerialCommunicationPlugin = FlutterSerialCommunication();

EventChannel eventChannel = _flutterSerialCommunicationPlugin.getDeviceConnectionListener();
eventChannel.receiveBroadcastStream().listen((event) {
  debugPrint("Received From Native:  $event");
});

Implementation

श्रेणियाँ

निर्भरताएँ

निर्भरता सूची 1 आइटम

  • plugin_platform_interface^2.0.2

सोर्स रिपॉज़िटरी

इस पैकेज का उपयोग करने वाले प्रोजेक्ट

अभी कोई डेटा उपलब्ध नहीं है।