How to use python-can send a tx message(can message) - python-can

import can
bus = can.Bus(interface='vector',
app_name='CANoe',
channel=[0],
receive_own_messages=True)
message = can.Message(arbitration_id=123,data=[0x11, 0x22, 0x33])
print("send msg:")
print(message)
bus.send(message, timeout=0.2)`enter code here`
print("received msg:")
print(bus.recv())
bus.shutdown()
output:
send msg:
Timestamp: 0.000000 ID: 0000007b X Rx DL: 3 11 22 33
received msg:
Timestamp: 1647263400.094132 ID: 0000 S Rx E DL: 0

Related

Test API toMatchObject() jest expect function

I'm trying to check if a response from the body matches partially an object of data "partialLaunchData" . I'm surprised to get this error:
● Test POST /launches › It should respond with 201 success created
expect(received).toMatchObject(expected)
- Expected - 3
+ Received + 13
Object {
- "mission": "Kepler_155",
- "rocket": "Explorer IS1",
- "target": "Kepler-186 f",
+ "launch": Object {
+ "customer": Array [
+ "SAFTA",
+ "NASA",
+ ],
+ "flightNumber": 101,
+ "launchDate": "2022-10-13T21:24:59.189Z",
+ "mission": "Kepler Exploration x",
+ "rocket": " Explorer IS1",
+ "success": true,
+ "target": "Kepler-442",
+ "upcoming": true,
+ },
}
42 | const responseDate= Date(response.body.launchDate).valueOf();
43 | expect(responseDate).toBe(requestDate);
> 44 | expect(response.body).toMatchObject(partialLaunchData);
| ^
45 | })
46 | //tests on the propreties sent
47 | test('It should catch missing required propreties', ()=>{});
at Object.toMatchObject (src/routes/launches/launches.test.js:44:31)
Test Suites: 1 failed, 1 total
Tests: 1 failed, 3 passed, 4 total
Snapshots: 0 total
Time: 3.452 s
Ran all test suites.
This is my Code in the launches.test.js file describing a post Test on launches path "/launches" .
describe( 'Test POST /launches ', ()=> {
// test the response
const completeLaunchData={
// flightNumber: 100,
mission: 'Kepler Exploration x',
rocket: ' Explorer IS1',
launchDate: new Date(),
target: 'Kepler-442',
// customer: ['SpaceX, NASA'],
// upcoming: true,
}
const partialLaunchData={
// flightNumber: 100,
mission: 'Kepler_155',
rocket: 'Explorer IS1',
target: 'Kepler-186 f',
// upcoming: true,
}
test('It should respond with 201 success created', async()=>{
const response = await request(app).post('/launches')
// comparing two dates and joining them in one format : we will compare the value of the two dates
.send(
completeLaunchData
)
.expect('Content-Type',/json/)
.expect(201);
const requestDate = Date(completeLaunchData.launchDate).valueOf();
const responseDate= Date(response.body.launchDate).valueOf();
expect(responseDate).toBe(requestDate);
expect(response.body).toMatchObject(partialLaunchData);
})
Who has an idea about the issue ? I need help please.

WebUSB .claimInterface never returns on Windows

I have been working on an website that uses WebUSB. The WebUSB library works 100% on Linux and Android. Unfortunately on Windows the promise returned by .claimInterface never returns anything, ever. And when I, for interest sake, run the claimInterface again the returned promise returns the error "An operation that changes state is in progress", confirming that the first claimInterface function is still busy.
The problem only occurs when claiming interface 1, claiming interface 0 works, but this interface is of no use to me. The USB device is not standard (descriptor dieplayed below) so it might be something about the device configuration, but it is really hard to tell with the lack of logs.
I did try and look at chrome://device-log?refresh=1 for additional logs, but only the plug events are dislpayed. I also enabled the new USB backend at chrome://flags/#new-usb-backend to no avail. I also tried running chrome with the --enable-loging --v1, but the only error that seemed relevant is: ERROR:device_event_log_impl.cc(211)] [01:32:33.170] USB: usb_device_handle_win.cc:1020 Failed to read descriptor from node connection: A device attached to the system is not functioning. (0x1F) .
But this error is logged before I have even connected a device, also discussed here, so I do not even know if it is relevant.
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 2 Communications
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0xXXXX XXX
idProduct 0xXXXX
bcdDevice 1.01
iManufacturer 1 XXX
iProduct 2 XXX
iSerial 3 XXX
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 0x0030
bNumInterfaces 2
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x40
(Missing must-be-set bit!)
Self Powered
MaxPower 100mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 10 CDC Data
bInterfaceSubClass 0
bInterfaceProtocol 1
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x83 EP 3 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 32
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 10 CDC Data
bInterfaceSubClass 0
bInterfaceProtocol 1
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 32
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x01 EP 1 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 32
can't get device qualifier: Resource temporarily unavailable
can't get debug descriptor: Resource temporarily unavailable
Device Status: 0x0001
Self Powered
The driver installation is almost identical to the WinUSB predescribed method.
[Version]
DriverVer=XX/XX/XXXX,X.X.X.X
Signature = "$Windows NT$"
Class = USBDevice
ClassGuid = {88BAE032-5A81-49f0-BC3D-A4FF138216D6}
Provider = %ManufacturerName%
CatalogFile = XXX.cat
[ClassInstall32]
AddReg = ClassInstall_AddReg
[ClassInstall_AddReg]
HKR,,,,%ClassName%
HKR,,NoInstallClass,,1
HKR,,IconPath,%REG_MULTI_SZ%,"%systemroot%\system32\setupapi.dll,-20"
HKR,,LowerLogoVersion,,5.2
[WinUSBDeviceClassReg]
HKR,,,0,%ClassName%
HKR,,Icon,,-20
[Manufacturer]
%ManufacturerName% = Standard,NTx86,NTamd64
[Standard.NTx86]
%DeviceName% = USB_Install, USB\%VendorID%&%ProductID%
[Standard.NTamd64]
%DeviceName% = USB_Install, USB\%VendorID%&%ProductID%
[USB_Install]
Include=winusb.inf
Needs=WINUSB.NT
[USB_Install.Services]
Include=winusb.inf
Needs=WINUSB.NT.Services
[USB_Install.HW]
AddReg=Dev_AddReg
[Dev_AddReg]
HKR,,DeviceInterfaceGUIDs,0x10000,{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}
[Strings]
ManufacturerName = "XXX"
ClassName="Universal Serial Bus devices"
DeviceName = "XXX"
VendorID = "VID_XXX"
ProductID = "PID_XXX"
As well as a React App I used to test the library.
import { useEffect, useState } from 'react';
export default function App() {
const [devices, setDevices] = useState([]);
useEffect(function () {
update()
navigator.usb.addEventListener("connect", update);
navigator.usb.addEventListener("disconnect", update);
}, [])
return (
<div className="App">
<button onClick={refresh}>
<div>Refresh</div>
</button>
<button onClick={connect}>
<div>Connect</div>
</button>
</div>
);
function connect() {
let _device = devices[0]
if (_device) {
_device
.open()
.then(function () {
_device
.selectConfiguration(1)
.then(function () {
console.log("Connecting to interface")
_device
.claimInterface(1)
.then(function () {
console.log("Success");
})
.catch(console.error);
})
.catch(console.error);
})
.catch(console.error);
}
}
function update() {
navigator.usb.getDevices().then(function (_devices) {
setDevices(_devices)
});
}
function refresh() {
navigator.usb
?.requestDevice({
filters: [{ vendorId: 0xXXXX, productId: 0xXXXX }],
})
.then(update)
.catch(console.error);
}
}
I downloaded goole-chrome canary 89.0.4387.0 and it solved the problem. So I guess that is just google, solving the problem before I even asked the question.

PCI driver 'Oops: Kernel access of bad area' error

I wanted to write a simple PCI express driver for Xilinx FPGA. But I am not able to request memory region for PCI.
Question is: How to claim that I/O memory area for custom driver. I want to write 3. byte of that area using driver.
Below are the details. What am I missing ? Thanks
1-) I am getting this error:
[ 4.345350] Unable to handle kernel paging request for data at address 0x00000005
[ 4.353978] Faulting instruction address: 0x80000000002c9370
[ 4.358337] Oops: Kernel access of bad area, sig: 11 [#1]
[ 4.362426] BE SMP NR_CPUS=24 CoreNet Generic
[ 4.365477] Modules linked in: fpgapcie(O+) ucc_uart
[ 4.369139] CPU: 0 PID: 1999 Comm: udevd Tainted: G O 4.19.26+gc0c2141 #1
[ 4.375924] NIP: 80000000002c9370 LR: 80000000002c9350 CTR: c00000000053acfc
[ 4.381753] REGS: c0000001ee2bb1c0 TRAP: 0300 Tainted: G O (4.19.26+gc0c2141)
[ 4.389146] MSR: 000000008002b000 <CE,EE,FP,ME> CR: 22228242 XER: 20000000
[ 4.394982] DEAR: 0000000000000005 ESR: 0000000000800000 IRQMASK: 0
GPR00: 80000000002c9350 c0000001ee2bb440 80000000002d1f00 000000000000001a
GPR04: 0000000000000001 000000000000022d c000000000f30548 c000000001013000
GPR08: 00000001fec37000 0000000000000003 0000000000000000 0000000000000020
GPR12: 0000000028228444 c000000001013000 0000000000020000 000000013c323ac8
GPR16: 000000013c323ae0 80000000002cc000 c000000000a194b0 c0000001f0eaa1c0
GPR20: 00000000006000c0 c000000000ed9da0 0000000000000000 0000000000000100
GPR24: 000000000000001c 000000000f700000 c0000001f3034880 0000000000000000
GPR28: c0000001f337b800 00000000000000f7 c0000001f337b8a0 0000000000000000
2-) Code piece in PCI probe function:
static int pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
{
int ret, minor;
struct cdev *cdev;
dev_t devno;
unsigned long pci_io_addr = 0;
/* add this pci device in pci_cdev */
if ((minor = pci_cdev_add(pci_cdev, MAX_DEVICE, dev)) < 0)
goto error;
/* compute major/minor number */
devno = MKDEV(major, minor);
/* allocate struct cdev */
cdev = cdev_alloc();
/* initialise struct cde
cdev_init(cdev, &pci_ops);
cdev->owner = THIS_MODULE;
/* register cdev */
ret = cdev_add(cdev, devno, 1);
if (ret < 0) {
dev_err(&(dev->dev), "Can't register character device\n");
goto error;
}
pci_cdev[minor].cdev = cdev;
dev_info(&(dev->dev), "%s The major device number is %d (%d).\n",
"Registeration is a success", MAJOR(devno), MINOR(devno));
dev_info(&(dev->dev), "If you want to talk to the device driver,\n");
dev_info(&(dev->dev), "you'll have to create a device file. \n");
dev_info(&(dev->dev), "We suggest you use:\n");
dev_info(&(dev->dev), "mknod %s c %d %d\n", DEVICE_NAME, MAJOR(devno), MINOR(devno));
dev_info(&(dev->dev), "The device file name is important, because\n");
dev_info(&(dev->dev), "the ioctl program assumes that's the\n");
dev_info(&(dev->dev), "file you'll use.\n");
/* enable the device */
pci_enable_device(dev);
/* 'alloc' IO to talk with the card */
if (pci_request_region(dev, BAR_IO, "IO-pci") == 0) {
printk(KERN_ALERT "The memory you requested from fpgapcie is already reserved by CORE pci driver.");
}
check that BAR_IO is *really* IO region
if ((pci_resource_flags(dev, BAR_IO) & IORESOURCE_IO) != IORESOURCE_IO) {
dev_err(&(dev->dev), "BAR2 isn't an IO region\n");
cdev_del(cdev);
goto error;
}
pci_io_addr = pci_resource_start(dev,BAR_IO);
printk(KERN_INFO "PCI start adress: %02X", &pci_io_addr);
outb(pci_io_addr+3, 5);
printk(KERN_INFO "Message from PCI device to user: 5");
return 1;
error:
printk(KERN_INFO "An error occuder while probing pci");
return 0;
}
3-) lspci -v output:
0001:01:00.0 Memory controller: Xilinx Corporation Device 7021
Subsystem: Xilinx Corporation Device 0007
Flags: bus master, fast devsel, latency 0, IRQ 41
Memory at c10000000 (32-bit, non-prefetchable) [size=2K]
Capabilities: [40] Power Management version 3
Capabilities: [48] MSI: Enable- Count=1/1 Maskable- 64bit+
Capabilities: [60] Express Endpoint, MSI 00
Capabilities: [100] Device Serial Number 00-00-00-01-01-00-0a-35
Kernel driver in use: yusufpci
Kernel modules: fpgapcie
4-) full dmesg:
[ 4.285663] Module pci init
[ 4.294787] yusufpci 0001:01:00.0: Registeration is a success The major device number is 247 (0).
[ 4.302367] yusufpci 0001:01:00.0: If you want to talk to the device driver,
[ 4.308116] yusufpci 0001:01:00.0: you'll have to create a device file.
[ 4.313516] yusufpci 0001:01:00.0: We suggest you use:
[ 4.317354] yusufpci 0001:01:00.0: mknod virtual_pci c 247 0
[ 4.321713] yusufpci 0001:01:00.0: The device file name is important, because
[ 4.327553] yusufpci 0001:01:00.0: the ioctl program assumes that's the
[ 4.332866] yusufpci 0001:01:00.0: file you'll use.
[ 4.336459] The memory you requested from fpgapcie is already reserved by CORE pci driver. This is not an error.
[ 4.336463] PCI start adress: EE2BB4B0
[ 4.345350] Unable to handle kernel paging request for data at address 0x00000005
[ 4.353978] Faulting instruction address: 0x80000000002c9370
[ 4.358337] Oops: Kernel access of bad area, sig: 11 [#1]
[ 4.362426] BE SMP NR_CPUS=24 CoreNet Generic
[ 4.365477] Modules linked in: fpgapcie(O+) ucc_uart
[ 4.369139] CPU: 0 PID: 1999 Comm: udevd Tainted: G O 4.19.26+gc0c2141 #1
[ 4.375924] NIP: 80000000002c9370 LR: 80000000002c9350 CTR: c00000000053acfc
[ 4.381753] REGS: c0000001ee2bb1c0 TRAP: 0300 Tainted: G O (4.19.26+gc0c2141)
[ 4.389146] MSR: 000000008002b000 <CE,EE,FP,ME> CR: 22228242 XER: 20000000
[ 4.394982] DEAR: 0000000000000005 ESR: 0000000000800000 IRQMASK: 0
GPR00: 80000000002c9350 c0000001ee2bb440 80000000002d1f00 000000000000001a
GPR04: 0000000000000001 000000000000022d c000000000f30548 c000000001013000
GPR08: 00000001fec37000 0000000000000003 0000000000000000 0000000000000020
GPR12: 0000000028228444 c000000001013000 0000000000020000 000000013c323ac8
GPR16: 000000013c323ae0 80000000002cc000 c000000000a194b0 c0000001f0eaa1c0
GPR20: 00000000006000c0 c000000000ed9da0 0000000000000000 0000000000000100
GPR24: 000000000000001c 000000000f700000 c0000001f3034880 0000000000000000
GPR28: c0000001f337b800 00000000000000f7 c0000001f337b8a0 0000000000000000
[ 4.453632] NIP [80000000002c9370] .pci_probe+0x220/0x2b4 [fpgapcie]
[ 4.458680] LR [80000000002c9350] .pci_probe+0x200/0x2b4 [fpgapcie]
[ 4.463639] Call Trace:
[ 4.464775] [c0000001ee2bb440] [80000000002c9350] .pci_probe+0x200/0x2b4 [fpgapcie] (unreliable)
[ 4.472262] [c0000001ee2bb500] [c0000000004b77c8] .pci_device_probe+0x11c/0x1f4
[ 4.478270] [c0000001ee2bb5a0] [c000000000561ebc] .really_probe+0x26c/0x38c
[ 4.483927] [c0000001ee2bb640] [c0000000005621ac] .driver_probe_device+0x78/0x154
[ 4.490106] [c0000001ee2bb6d0] [c0000000005623d8] .__driver_attach+0x150/0x154
[ 4.496025] [c0000001ee2bb760] [c00000000055f424] .bus_for_each_dev+0x94/0xdc
[ 4.501856] [c0000001ee2bb800] [c0000000005615fc] .driver_attach+0x24/0x38
[ 4.507426] [c0000001ee2bb870] [c000000000560ec8] .bus_add_driver+0x264/0x2a4
[ 4.513258] [c0000001ee2bb910] [c000000000563384] .driver_register+0x88/0x178
[ 4.519089] [c0000001ee2bb990] [c0000000004b5a68] .__pci_register_driver+0x50/0x64
[ 4.525355] [c0000001ee2bba00] [80000000002c9564] .pci_init_module+0xc0/0x444 [fpgapcie]
[ 4.532144] [c0000001ee2bba80] [c0000000000020b4] .do_one_initcall+0x64/0x224
[ 4.537978] [c0000001ee2bbb50] [c0000000000f443c] .do_init_module+0x70/0x260
[ 4.543722] [c0000001ee2bbbf0] [c0000000000f6564] .load_module+0x1e6c/0x2400
[ 4.549467] [c0000001ee2bbd10] [c0000000000f6d28] .__se_sys_finit_module+0xcc/0x100
[ 4.555819] [c0000001ee2bbe30] [c0000000000006b0] system_call+0x60/0x6c
[ 4.561127] Instruction dump:
[ 4.562785] e86a8080 38810070 f9210070 4800041d e8410028 e9210070 3d420000 e94a8088
[ 4.569231] 39290003 5529063e e94a0000 7c0004ac <992a0005> 39200001 3d420000 992d0684
[ 4.575854] ---[ end trace 2d15cff7ba1b3255 ]---
Problem solved. But when I write the third byte of Memory Mapped area, FPGA programmed to answer with lighting its GPIO leds. I tried to write first 15 byte of MMIO but it did not work. The leds did not lighted. But the code stopped giving errors.
I also cannot read the bytes on MMIO space using readb() function. It's
giving
unrecoverable machine check error
Problem solved using this code.
pci_request_regions(dev, "fpgapcie");
pci_io_startaddr = pci_resource_start(dev,BAR_IO);
pci_io_endaddr = pci_resource_end(dev,BAR_IO);
pci_io_size = pci_resource_len(dev,BAR_IO);
printk(KERN_INFO "Region start: %lX, Region end: %lX, Size: % lX",pci_io_startaddr,pci_io_endaddr,pci_io_size);
pci_io_addr = ioremap(pci_io_startaddr, pci_io_endaddr);
printk(KERN_INFO "PCI start adress: %lX", pci_io_addr);
for(i = 0;i<15;i++) /* Write first 15 byte */
{
writeb(2, pci_io_addr+i);
printk(KERN_INFO "%lX, Message from PCI device to user: 2", pci_io_addr+i);
}
and the dmesg output:
fpgapcie: loading out-of-tree module taints kernel.
fpgapcie 0001:01:00.0: Registeration is a success The major device number is 247 (0).
fpgapcie 0001:01:00.0: If you want to talk to the device driver,
fsl-fman-port ffe488000.port fm1-gb0: renamed from eth0
fpgapcie 0001:01:00.0: you'll have to create a device file.
fpgapcie 0001:01:00.0: We suggest you use:
fpgapcie 0001:01:00.0: mknod virtual_pci c 247 0
fpgapcie 0001:01:00.0: The device file name is important, because
fpgapcie 0001:01:00.0: the ioctl program assumes that's the
fpgapcie 0001:01:00.0: file you'll use.
Region start: 210000000, Region end: 2100007FF, Size: 800
PCI start adress: 8000080088900000
8000080088900000, Message from PCI device to user: 2
8000080088900001, Message from PCI device to user: 2
8000080088900002, Message from PCI device to user: 2
8000080088900003, Message from PCI device to user: 2
8000080088900004, Message from PCI device to user: 2
8000080088900005, Message from PCI device to user: 2
8000080088900006, Message from PCI device to user: 2
8000080088900007, Message from PCI device to user: 2
8000080088900008, Message from PCI device to user: 2
8000080088900009, Message from PCI device to user: 2
800008008890000A, Message from PCI device to user: 2
800008008890000B, Message from PCI device to user: 2
800008008890000C, Message from PCI device to user: 2
800008008890000D, Message from PCI device to user: 2
800008008890000E, Message from PCI device to user: 2

Why do I have only one thread id when using Async.Parallel?

Why do I have only one processor id when using Async.Parallel?
Code:
open System
open System.Threading
[for i in 1..10 -> async {return i}] |> Async.Parallel
|> Async.RunSynchronously
|> Seq.iter (fun i -> printfn "Processor Id: %d Value: %d" Thread.CurrentThread.ManagedThreadId i)
Output:
Processor Id: 1 Value: 1
Processor Id: 1 Value: 2
Processor Id: 1 Value: 3
Processor Id: 1 Value: 4
Processor Id: 1 Value: 5
Processor Id: 1 Value: 6
Processor Id: 1 Value: 7
Processor Id: 1 Value: 8
Processor Id: 1 Value: 9
Processor Id: 1 Value: 10
val it : unit = ()
>
You're doing printfn from your main thread, outside your async workflow. Try this:
[for i in 1..10 ->
async {return sprintf "Processor Id: %d Value: %d" Thread.CurrentThread.ManagedThreadId i}]
|> Async.Parallel
|> Async.RunSynchronously

Phone as bluetooth GPS for Linux PC

I have a phone (SE j10i) with GPS. I want to get the coordinates from the phone on my Debian PC.
$hcitool scan
Scanning ...
30:17:C8:A1:19:BF Uralbash
$spdtool browse 30:17:C8:A1:19:BF
Browsing 30:17:C8:A1:19:BF ...
Service Description: Sony Ericsson J10
Service RecHandle: 0x10000
Service Class ID List:
"PnP Information" (0x1200)
Service Name: OBEX SyncML Client
Service RecHandle: 0x2008002
Service Class ID List:
UUID 128: 00000002-0000-1000-8000-0002ee000002
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 10
"OBEX" (0x0008)
Service Name: Serial Port 1
Service RecHandle: 0x2008003
Service Class ID List:
"Serial Port" (0x1101)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 2
Service Name: Dial-up Networking
Service RecHandle: 0x2008004
Service Class ID List:
"Dialup Networking" (0x1103)
"Generic Networking" (0x1201)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 1
Profile Descriptor List:
"Dialup Networking" (0x1103)
Version: 0x0100
Service Name: Music Streaming Service
Service Provider: Sony Ericsson
Service RecHandle: 0x8000001
Service Class ID List:
"Audio Source" (0x110a)
Protocol Descriptor List:
"L2CAP" (0x0100)
PSM: 25
"AVDTP" (0x0019)
uint16: 0x100
Profile Descriptor List:
"Advanced Audio" (0x110d)
Version: 0x0100
Service Name: Remote Control Target Service
Service Provider: Sony Ericsson
Service RecHandle: 0x10000001
Service Class ID List:
"AV Remote Target" (0x110c)
Protocol Descriptor List:
"L2CAP" (0x0100)
PSM: 23
"AVCTP" (0x0017)
uint16: 0x102
Profile Descriptor List:
"AV Remote" (0x110e)
Version: 0x0103
Service Name: Remote Control Service
Service Provider: Sony Ericsson
Service RecHandle: 0x10000002
Service Class ID List:
"AV Remote" (0x110e)
Protocol Descriptor List:
"L2CAP" (0x0100)
PSM: 23
"AVCTP" (0x0017)
uint16: 0x102
Profile Descriptor List:
"AV Remote" (0x110e)
Version: 0x0103
Service Name: SEMC Watch Phone
Service RecHandle: 0x40000000
Service Class ID List:
"" (0x8e771401)
Protocol Descriptor List:
"L2CAP" (0x0100)
PSM: 61681
"RFCOMM" (0x0003)
Channel: 2
Service Name: SEMC FRCP
Service RecHandle: 0x40000001
Service Class ID List:
"" (0x8e771503)
Protocol Descriptor List:
"L2CAP" (0x0100)
PSM: 61691
Profile Descriptor List:
"" (0x8e771501)
Version: 0x0100
Service Name: PAN Network Access Point
Service Description: NAP provides access to internet for one connecting PANu
Service RecHandle: 0x1000003
Service Class ID List:
"Network Access Point" (0x1116)
Protocol Descriptor List:
"L2CAP" (0x0100)
PSM: 15
"BNEP" (0x000f)
Version: 0x0100
SEQ8: 0 6 dd
Language Base Attr List:
code_ISO639: 0x656e
encoding: 0x6a
base_offset: 0x100
Profile Descriptor List:
"Network Access Point" (0x1116)
Version: 0x0100
Service Name: PAN user
Service Description: PANu can connect to a Network Access Point to gain access to internet
Service RecHandle: 0x1000004
Service Class ID List:
"PAN User" (0x1115)
Protocol Descriptor List:
"L2CAP" (0x0100)
PSM: 15
"BNEP" (0x000f)
Version: 0x0100
SEQ8: 0 6 dd
Language Base Attr List:
code_ISO639: 0x656e
encoding: 0x6a
base_offset: 0x100
Profile Descriptor List:
"PAN User" (0x1115)
Version: 0x0100
Service Name: SEMC HLA
Service RecHandle: 0x40000002
Service Class ID List:
"" (0x8e771301)
Protocol Descriptor List:
"L2CAP" (0x0100)
PSM: 61689
"" (0x8e770300)
Profile Descriptor List:
"" (0x8e771303)
Version: 0x0100
Service Name: SEMC OBP
Service RecHandle: 0x40000003
Service Class ID List:
"" (0x8e771602)
Protocol Descriptor List:
"L2CAP" (0x0100)
PSM: 61685
"" (0x8e770300)
Profile Descriptor List:
"" (0x8e771601)
Version: 0x0100
Service Name: Hands-Free Gateway
Service RecHandle: 0x2008005
Service Class ID List:
"Handsfree Audio Gateway" (0x111f)
"Generic Audio" (0x1203)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 5
Profile Descriptor List:
"Handsfree" (0x111e)
Version: 0x0105
Service Name: Headset Gateway
Service RecHandle: 0x2008006
Service Class ID List:
"Headset Audio Gateway" (0x1112)
"Generic Audio" (0x1203)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 4
Profile Descriptor List:
"Headset" (0x1108)
Version: 0x0100
Service Name: OBEX Object Push
Service RecHandle: 0x2008007
Service Class ID List:
"OBEX Object Push" (0x1105)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 6
"OBEX" (0x0008)
Profile Descriptor List:
"OBEX Object Push" (0x1105)
Version: 0x0100
Service Name: OBEX File Transfer
Service RecHandle: 0x2008008
Service Class ID List:
"OBEX File Transfer" (0x1106)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 7
"OBEX" (0x0008)
Profile Descriptor List:
"OBEX File Transfer" (0x1106)
Version: 0x0100
Service Name: OBEX IrMC Sync Server
Service RecHandle: 0x2008009
Service Class ID List:
"IrMC Sync" (0x1104)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 8
"OBEX" (0x0008)
Profile Descriptor List:
"IrMC Sync" (0x1104)
Version: 0x0100
Service Name: Phonebook Access PSE
Service RecHandle: 0x200800a
Service Class ID List:
"Phonebook Access - PSE" (0x112f)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 11
"OBEX" (0x0008)
Profile Descriptor List:
"Phonebook Access" (0x1130)
Version: 0x0100
I use a serial port channel 2. My setting from /etc/bluetooth/rfcomm.comm
$cat /etc/bluetooth/rfcomm.conf
rfcomm0 {
# Automatically bind the device at startup
bind yes;
# Bluetooth address of the device
device 30:17:C8:A1:18:BF;
# RFCOMM channel for the connection
channel 2;
# Description of the connection
comment "SE Elm (Uralbash)";
}
Next I try to connect to serial port.
$sudo rfcomm bind rfcomm0
$rfcomm
rfcomm0: 30:17:C8:A1:18:BF channel 2 clean
$sudo cat /dev/rfcomm0
cat: /dev/rfcomm0: Host is down
$sudo /etc/init.d/bluetooth restart
[ ok ] Stopping bluetooth: /usr/sbin/bluetoothd.
[ ok ] Starting bluetooth: bluetoothd.
$sudo cat /dev/rfcomm0
cat: /dev/rfcomm0: Host is down
$sudo rfcomm release 0
$sudo /etc/init.d/bluetooth restart
[ ok ] Stopping bluetooth: /usr/sbin/bluetoothd.
[ ok ] Starting bluetooth: bluetoothd.
$rfcomm show 0
rfcomm0: 30:17:C8:A1:18:BF channel 2 clean
$rfcomm connect 0
Can't connect RFCOMM socket: Host is down
What is wrong?

Resources