Plugin.BluetoothClassic for Xamarin. Tutorial. IBluetoothConnection

  Переглядів 7,781

Электротехника для программистов :: Практика

Электротехника для программистов :: Практика

3 роки тому

Plugin.BluetoothClassic for Xamarin is a plug-in that supports transmitting/receiving data through Bluetooth Classic connection.
git: github.com/rostislav-nikitin/...
NuGe packaget: www.nuget.org/packages/Plugin...

КОМЕНТАРІ: 89
@HOSHINO_KAEDE
@HOSHINO_KAEDE 2 місяці тому
So amazing! Xamarin's guidance video is few, thank to you!
@user-ek2uy6qq5v
@user-ek2uy6qq5v 2 місяці тому
No problems! Glad that it was helpful for you!
@stanleygarciafletes4363
@stanleygarciafletes4363 7 місяців тому
excellent video, very helpfull, tanks for sharing
@emrebayram3629
@emrebayram3629 3 роки тому
thank u bro , good video and project
@user-ek2uy6qq5v
@user-ek2uy6qq5v 3 роки тому
Hello. Thank you for the feedback. Glad that it was helpful to you )
@rubenpena903
@rubenpena903 Рік тому
Hi Rostyslav. First of all, thank you!!! Could you make an example where an app continuously receives data from another device? Something like a terminal. The example where you receive a byte works perfectly for me, but I can't make a continuous connection work correctly. Thanks again from Argentina!
@user-ek2uy6qq5v
@user-ek2uy6qq5v Рік тому
Hello. Yep, such an example already exists. All you need is to use ManagedConnection. Example: github.com/rostislav-nikitin/Plugin.BluetoothClassic/tree/master/examples/Digit My greetings to Argentina!
@user-mf8pb4eo8g
@user-mf8pb4eo8g 2 роки тому
Thank you for the good video, but i have a question. Does the value of the sensors sent and received up there matter what sensor is used? if i use moisture sensor, can express moisture percent at this display?
@user-ek2uy6qq5v
@user-ek2uy6qq5v 2 роки тому
Thank you for the feedback. > Does the value of the sensors sent and received up there matter what sensor is used? Nope, you can use any sensor. >if i use moisture sensor, can express moisture percent at this display? Sure
@user-mf8pb4eo8g
@user-mf8pb4eo8g 2 роки тому
@@user-ek2uy6qq5v thanks answer ! ^^ Then can I just connect to Bluetooth without writing the code?
@user-ek2uy6qq5v
@user-ek2uy6qq5v 2 роки тому
@@user-mf8pb4eo8g It depends on the format of the data your sensor is sending.
@user-mf8pb4eo8g
@user-mf8pb4eo8g 2 роки тому
@@user-ek2uy6qq5v Where should I fix to get the data I want?
@user-ek2uy6qq5v
@user-ek2uy6qq5v 2 роки тому
@@user-mf8pb4eo8g There: github.com/rostislav-nikitin/Plugin.BluetoothClassic/blob/9d9ce30f8ee875b3d9e456dd05ca8549b0df987a/examples/Digit/Digit/DigitPage.xaml.cs#L56
@valentinp3795
@valentinp3795 3 роки тому
Such a great video !! You deserve more view !! You saved me !! Keep going !!!
@user-ek2uy6qq5v
@user-ek2uy6qq5v 3 роки тому
Thank you. I'm glad you found it helpful!
@valentinp3795
@valentinp3795 3 роки тому
@@user-ek2uy6qq5v i was wondering what kind of bluetooth module are you using? hc-05 or hc-06. Because I'm using an hc-05 with an arduino and after 2 sending with the app the connection is lost. have you an idea about this issue ? Again : great video !
@user-ek2uy6qq5v
@user-ek2uy6qq5v 3 роки тому
@@valentinp3795 Hello. I am using HC-06. Yep, I had same problems before. It was working some seconds and then connection was down. In my case it was because of bad connection between MCU and BT module. I used contact less breadboard. And when I changed wires, reconnected everything then problem was gone... No problems.
@valentinp3795
@valentinp3795 3 роки тому
@@user-ek2uy6qq5v ok thank you, I've check my connection but the probleme is still here. Never mind I would try with an hc-06 (I use an hc-05). Do you know how to add a text to say if the module is steel connect to the app ? to check if the issue comme from the arduino code or frome the app (maybe the baud rate). Where can I find the bookstore orders? Are you going to make other videos on Xamarin? Thank you for your prompt response !
@user-ek2uy6qq5v
@user-ek2uy6qq5v 3 роки тому
@@valentinp3795 >Do you know how to add a text to say if the module is steel connect to the app ? What kind of connection you using: IBluetoothConnection or IBluetoothManagedConnection? >to check if the issue comme from the arduino code or frome the app (maybe the baud rate). You can connect to the Bluetooth module from the PC. It should support AT commands and check baud rate. I think better to read manual from the your particular HC-xx module, because this settings can be firmware specific. > Where can I find the bookstore orders? What you mean? What you talking about? >Are you going to make other videos on Xamarin? I have a such plans, but I don't know when. >Thank you for your prompt response ! No problems.
@cris1185
@cris1185 7 місяців тому
could you have an example sending char[] in the Transmit?
@user-ek2uy6qq5v
@user-ek2uy6qq5v 7 місяців тому
Hello. Yep. github.com/rostislav-nikitin/Plugin.BluetoothClassic/blob/005cb6019cb6f073a25fd8839a9354c1b5bb5b33/examples/Digit/Digit/DigitPage.xaml.cs#L85
@joeldjofang6809
@joeldjofang6809 2 роки тому
Good morning! please, how to receive multiple digit like data from a sensor with your code. Thank you!
@nkokarovtsev
@nkokarovtsev Рік тому
Здравствуйте, спасибо за видео. Можно ли как нибудь считывать уровень блютуз сигнала с устройства (например hc-05) ?
@user-ek2uy6qq5v
@user-ek2uy6qq5v Рік тому
Здравствуйте. Рад что Вам данное видео было полезно. >Можно ли как нибудь считывать уровень блютуз сигнала с устройства (например hc-05) ? Всё зависет от конкретного девайса. Наверняка есть устройства которые позволяют это делать. Вам нужно скачать datasheet или reference manual от конкртетного устройства и посмотреть что именно оно поддерживает и как получить доступ к этим функциям.
@eduardotutu
@eduardotutu Рік тому
will it be Maui compatible?
@gglesupport9616
@gglesupport9616 Рік тому
Здравствуйте, а получится установить таким образом связь между двумя телефонами/планшетами на Android?
@SyahrialRukmana
@SyahrialRukmana 2 роки тому
How to receiving data and display it ?
@Zodiacosa
@Zodiacosa Рік тому
Ростислав, снова здравствуйте! Интересно было бы посмотреть видео о передаче byte-данных между двумя Android-устройствами (или эмулятором на ПК и Android-телефоном), видел в комментариях похожие просьбы, думаю, не одному мне было полезно, спасибо за Ваш труд!
@user-ek2uy6qq5v
@user-ek2uy6qq5v Рік тому
Здравствуйте! К сожалению у меня есть только один андроид телефон, с подходящей версией андроида, в семье. Если вдруг появится второй, попробую провести подобный эксперимент. Рад, если Вам было полезно данное видео.
@user-hw4ce1fj8p
@user-hw4ce1fj8p 2 роки тому
Приветствую, а как можно организовать подключение к конкретному устройству (hc-05), без выбора из списка? Есть ли возможность задания конкретных параметров для подключения к определенному заранее устройству
@user-ek2uy6qq5v
@user-ek2uy6qq5v 2 роки тому
Здравствуйте. IBluetoothAdapter предоставляет свойство IEnumerable BondedDevices. В нём находятся все Paired Bluetooth устройства. Находите нужный путём перебора или LINQ и подключаетесь. Т.е. это на данный момент единственный реализованный вариант. Алгоритм такой: 1. На телефоне находите нужное устройтво 2. Подключаетесь к нему 3. Оно становится доступным в BondedDevices 4. Создаёте подключение 5. Передача данных
@user-hw4ce1fj8p
@user-hw4ce1fj8p 2 роки тому
@@user-ek2uy6qq5v Благодарю за помощь, видео очень помогло в написании приложения
@user-ek2uy6qq5v
@user-ek2uy6qq5v 2 роки тому
@@user-hw4ce1fj8p На здоровье. Рад что Вам помогло данное видео.
@unfuny10
@unfuny10 3 роки тому
Круто
@user-ek2uy6qq5v
@user-ek2uy6qq5v 3 роки тому
Спасибо! Рад что тебе понравилось.
@Zodiacosa
@Zodiacosa Рік тому
Здравствуйте, а если подключить 2 телефона между собой, то будут таким образом передаваться данные? (По типу передачи сообщений между ними) Или это работает только для телефона и датчика?
@user-ek2uy6qq5v
@user-ek2uy6qq5v Рік тому
Здравствуйте. Думаю будут, но на практике не пробовал.
@Zodiacosa
@Zodiacosa Рік тому
@@user-ek2uy6qq5v Спасибо за ответ! Я постараюсь проверить на практике и сообщить Вам, спасибо за Ваш пакет Bluetooth и видео, очень помогает👍🏻
@user-ek2uy6qq5v
@user-ek2uy6qq5v Рік тому
@@Zodiacosa Если получится это проверить, и Вы поделитесь своим опытом, буду Вам благодарен. Рад что Вам это оказалось полезно.
@Zodiacosa
@Zodiacosa Рік тому
Добрый вечер! Я пробовал использовать Ваш пример из GitHub (Digit) для установки связи между двумя телефонами (Android 11, MIUI), пакеты установил, разрешения дал, но подключение не установилось, причину узнать пока что не смог Также я немного переделал Ваш код, чтобы он отправлял данные не при изменении значения Digit, а при нажатии на кнопку, но также отправить, как и подключиться, не вышло
@phamngocquapham5472
@phamngocquapham5472 3 місяці тому
Thank you for the good video, but i have a question. I meet error "Java.Lang.SecurityException Message=Need android.permission.BLUETOOTH_CONNECT permission for AttributionSource". You can fix it. thank you very much.
@Pio2K_TH
@Pio2K_TH Рік тому
Can you make an example of connecting to Bluetooth and getting data all the time? without having to press a button to receive information
@Pio2K_TH
@Pio2K_TH Рік тому
Can you teach me how to write and receive data all the time after connecting to Bluetooth?
@thegaming5209
@thegaming5209 Рік тому
Does this plug-in also work for IOS? Because on your github repo there is only permissions for Android and not for ios.
@user-ek2uy6qq5v
@user-ek2uy6qq5v Рік тому
Hello. Nope, for now, this plug-in works just on Android.
@spaceroom830
@spaceroom830 Рік тому
Здравствуйте Ростислав, могли бы вы поделиться исходным кодом которым вы пользовались для создания ардуино устройства для передачи данных
@user-ek2uy6qq5v
@user-ek2uy6qq5v Рік тому
Здравствуйте. Дело в том что я пользовался не ардуино. Я пользовался микроконтроллером AVR ATmega8 + операционная система SoC OS. Вот её исходный код и примеры использования: github.com/rostislav-nikitin/socOS
@Mielesplayz
@Mielesplayz Рік тому
Does this also work in a .NET MAUI app?
@user-ek2uy6qq5v
@user-ek2uy6qq5v Рік тому
Hello. Didn't test in .NET MAUI. Developed and tested just on Android.
@TheHrushev
@TheHrushev 2 роки тому
Повторил код в своём проекте для теста. Появилась проблема. Если я ставлю брейкпоинт также как и автор на строку с методом отправки данных - всё нормально. После того, как я убираю брейкпоинт, первая после этого отправка данных завершается удачно, но уже следующая за удачной - заканчивается ошибкой подключения. После этого помогает только аппаратный перезагруз BT модуля. В общем - с устаноленным брейкпоинтом отправлять можно сколько угодно раз. Без - только 1 и всё, ошибка.
@TheHrushev
@TheHrushev 2 роки тому
Проект автора с гитхаба без единого изменения работает так же. UPD. При добавлении асинхронной задержки после установки соединения с BT модулем, проблема пропадает.
@shrutisharrma301
@shrutisharrma301 3 роки тому
Actually, in SelectDevicePage I am getting NullExveption for lvBondedDevices.ItemsSource = adapter.BondedDevices; can you please guide me where I am getting wrong
@RostislavNikitinHuman
@RostislavNikitinHuman 3 роки тому
Hello. I think your adapter variable is not set properly. Could you set breakepoint in that line and check lvBondedDevices and adapter for null?
@shrutisharrma301
@shrutisharrma301 3 роки тому
@@RostislavNikitinHuman thank you for replying Rostislav, I appreciate it. Yes I have already did that and it's getting null value, also I think because I don't want a bonded device, I want normal Bluetooth connection,so might be the problem.that being said couldyou please guide me how I can modify this for normal Bluetooth connection and not with bonded devicd
@RostislavNikitinHuman
@RostislavNikitinHuman 3 роки тому
@@shrutisharrma301 No problems. You getting null value for adapter or lvBondedDevices? Bonded devices are some external devices that paired with your device (mobile phone, etc.). And to create a connection you need to pair your mobile with at least one BT device.
@shrutisharrma301
@shrutisharrma301 3 роки тому
@@RostislavNikitinHuman Yes, unfortunately, getting null values for lvBondedDevices.ItemsSource
@shrutisharrma301
@shrutisharrma301 3 роки тому
@@RostislavNikitinHuman Yes, actually getting null value in lvBondedDevices.ItemsSource
@danielleijarobledo6864
@danielleijarobledo6864 3 роки тому
Me funcionó para Arduino. Gracias por la ayuda. ¿No sabes cómo puedo hacerlo en bucle? Estaría genial una explicación
@danielleijarobledo6864
@danielleijarobledo6864 3 роки тому
Me salvaste la vida, muy sencillo y bien explicado.
@RostislavNikitinHuman
@RostislavNikitinHuman 3 роки тому
@@danielleijarobledo6864 Hello. English please.
@hugov6280
@hugov6280 2 роки тому
Oye amigo, sabes cómo puedo hacer para que pueda recibir valores del bluetooth en un label? Quise reemplazar el stepperDigit.Value por un label.text pero me manda error. Sabes cómo puedo solucionarlo?
@hugov6280
@hugov6280 2 роки тому
El problema es que en la parte: var device = (BluetoothDeviceModel)BindingContext; me sale el siguiente error: specified cast is not valid. Me serviría de mucha ayuda tu respuesta amigo.
@enrickdemunter3182
@enrickdemunter3182 2 роки тому
can you post your arduino code? or can i find it somewhere?
@user-ek2uy6qq5v
@user-ek2uy6qq5v 2 роки тому
Hello Enrick. Sure. There there was used: github.com/rostislav-nikitin/Plugin.BluetoothClassic/tree/master/examples Or you can use this one: github.com/rostislav-nikitin/socOS
@enrickdemunter3182
@enrickdemunter3182 2 роки тому
@@user-ek2uy6qq5v Where can i find the arduino code?
@user-ek2uy6qq5v
@user-ek2uy6qq5v 2 роки тому
@@enrickdemunter3182 All examples are for the raw ATmega8 MCU. But I think you can install AVR Studio and with little modifications flash Arduino with one of the examples. Because Arduino's ATmeaga328 very similar to the ATmega8 but has more SRAM, EEPROM, etc.
@enrickdemunter3182
@enrickdemunter3182 2 роки тому
@@user-ek2uy6qq5v I understand but is there a repository where i can find your arduino code.
@yentlbaert9236
@yentlbaert9236 2 роки тому
@@user-ek2uy6qq5v I don't understand how the ATmega8 is receiving the input. What code is receiving the data on the hardware side?
@huron_vodka2398
@huron_vodka2398 11 місяців тому
Great video, I have a problem running the app: Java.Lang.SecurityException: 'Need android.permission.BLUETOOTH_CONNECT permission for AttributionSource { uid = 10464, packageName = com.companyname.plugin.bluetoothclassic, attributionTag = null, token = android.os.BinderProxy@3364673, next = null }: AdapterService getBondedDevices' I wrote the android Manifest file as shown in the video, do you have any idea why it doesn't work?
@hugov6280
@hugov6280 2 роки тому
How adapter. StartDiscovery(); Works? I need to scan devices and display in listview.
@user-ek2uy6qq5v
@user-ek2uy6qq5v 2 роки тому
Hello. It scans already paired devices and returns those which are now available.
@hugov6280
@hugov6280 2 роки тому
@@user-ek2uy6qq5v is there a way to show devices that are not paired?
Bluetooth Arduino RECEIVE data + Chart
9:26
Electronoobs
Переглядів 300 тис.
Why Doesn’t Everyone Use This Animation???
23:59
Theo - t3․gg
Переглядів 18 тис.
ФОКУС С ЧИПСАМИ (секрет)
00:44
Masomka
Переглядів 1,1 млн
Парковка Пошла Не По Плану 😨
00:12
Глеб Рандалайнен
Переглядів 11 млн
Арсенал VS Челсі - Огляд матчу
07:44
Setanta Sports Premier League
Переглядів 267 тис.
Xamarin Forms Bluetooth Receipt Printing
9:11
MrNawshad
Переглядів 9 тис.
Xamarin and Maui Sql Server (SSMS) Connection
23:38
Xamarin Guy
Переглядів 35 тис.
Quick C# application to connect with a Bluetooth LE device
35:50
Cornel Human
Переглядів 29 тис.
Build Anything with OpenAI Assistants, Here’s How
12:31
David Ondrej
Переглядів 9 тис.
Xamarin Forms Receipt Printing (Tutorial)
9:36
MrNawshad
Переглядів 13 тис.
Reading Bluetooth LE Device Details C# WPF
1:12:08
AngelSix
Переглядів 22 тис.
Discovering Bluetooth Devices BLE in C# and .Net Core
1:11:24
AngelSix
Переглядів 60 тис.
Xamarin Debug App On A Physical Device
8:35
Rabi Gurung
Переглядів 22 тис.
GOOGLE СДЕЛАЛИ НЕВОЗМОЖНОЕ! Это круче любого Samsung, Apple и Xiaomi…
13:16
Thebox - о технике и гаджетах
Переглядів 63 тис.
The Humble PC
24:07
Linus Tech Tips
Переглядів 875 тис.
The Humble PC
24:07
Linus Tech Tips
Переглядів 875 тис.
Зачем нужна эта кнопка?
0:25
Construct PC
Переглядів 403 тис.