This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.IO.Ports; | |
... | |
private void refresh_button_Click(object sender, EventArgs e) | |
{ | |
portlist_comboBox.Items.Clear(); | |
foreach (string s in SerialPort.GetPortNames()) | |
{ | |
portlist_comboBox.Items.Add(s); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void connect_button_Click(object sender, EventArgs e) | |
{ | |
... | |
string port_name = portlist_comboBox.SelectedItem.ToString(); // get serial port name | |
serial_port_ = new SerialPort(port_name, 9600); // set port name and speed 9600 bits/second | |
serial_port_.Open(); // connect to port | |
thread_ = new Thread(read_serial_port); // create thread for reading received data | |
thread_.Start(); | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
delegate void SetTextCallback(string newText); | |
private void add_output(string text) | |
{ | |
if (this.output_textBox.InvokeRequired) | |
{ | |
SetTextCallback d = new SetTextCallback(add_output); | |
this.Invoke(d, new object[] { text }); | |
} | |
else | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void setup() | |
{ | |
Serial.begin(9600); | |
} | |
void loop() | |
{ | |
if (0 < Serial.available()) // See is there any coming data | |
{ | |
char data = Serial.read(); // read first byte | |
Serial.println(data); // print data in HEX |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const int xpin = 0; | |
const int ypin = 1; | |
const int zpin = 2; | |
void setup() | |
{ | |
Serial.begin(9600); | |
} | |
void loop() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.ComponentModel; | |
using System.Data; | |
using System.Drawing; | |
using System.Linq; | |
using System.Text; | |
using System.Windows.Forms; | |
using System.IO.Ports; | |
using System.Threading; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <EEPROM.h> // include library | |
int sz; // size of received data | |
void setup() | |
{ | |
Serial.begin(9600); | |
sz = 0; | |
} | |
void loop() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Compile using "gcc -o scanner 1.c -lbluetooth" command | |
// System | |
#include <stdio.h> | |
#include <stdlib.h> | |
// Bluetooth | |
#include <bluetooth/bluetooth.h> | |
#include <bluetooth/hci.h> | |
#include <bluetooth/hci_lib.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//1004-1010 lines of src/hcidump.c | |
case 'i': | |
if (strcasecmp(optarg, "none") && strcasecmp(optarg, "system")) | |
device = atoi(optarg + 3); | |
else | |
device = HCI_DEV_NONE; | |
break; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
write(1, "HCI sniffer - Bluetooth packet a"..., 49) = 49 | |
socket(PF_BLUETOOTH, SOCK_RAW, 1) = 3 | |
bind(3, {sa_family=AF_BLUETOOTH, sa_data="\0\0\0\0\0\0\377\377\377\377\0\0\0\0"}, 6) = 0 | |
socket(PF_BLUETOOTH, SOCK_RAW, 1) = 4 | |
ioctl(4, HCIGETDEVINFO, 0x7ffff76cc630) = 0 | |
close(4) = 0 | |
ioctl(3, HCISETRAW, 0) = 0 | |
close(3) = 0 | |
socket(PF_BLUETOOTH, SOCK_RAW, 1) = 3 |
OlderNewer