So I want to block file transfer on windows device. Solution should do following things:
Block bluetooth file transfer via all bluetooth transfer apps
Not block other devices like: headphones, mouse, keyboard, and other peripherals
I tried this, it doesn't work:
Modify the registry item
HKEYLOCALMACHINE\SYSTEM\CurrentControlSet\services\BTHPORT\Parameters
Value name DisableFsquirt
Value type REG_DWORD
Value data 0x1 (1)
This registry setting only disable showing option Bluetooth device in "Send to" or Send/Receive a file over Bluetooth icon in taskbar.
But sending or receiving files are still possible via Bluetooth settings, or user can simply start fsquirt.exe.
If you use Windows Enterprise edition you can set Applocker to block fsquirt.exe.
Other devices should work normally, but sending/receiving files are blocked.
Related
I'm developing a project on an embedded Linux device in C, which uses those two USB drivers on the same USB cable:
g_printer(Linux USB Printer Gadget Driver)
g_serial(Linux Gadget Serial Driver)
When the user selects USB Virtual COM Mode, the program will:
Check whether the device file /dev/g_printer0 is opened, if yes, close the opened file descriptor.
Check whether the g_printer is installed by using system("lsmod | grep g_printer > /dev/null");, if yes, use system("rmmod g_printer); to uninstall it.
Check whether the usb_f_printer is installed by using system("lsmod | grep usb_f_printer > /dev/null");, if yes, use system("rmmod usb_f_printer); to uninstall it.
Install the g_serial by using system(modprobe g_serial);
Open device file /dev/ttyGS0
When the user selects USB Printer Mode, the program will do almost the same steps as above, but uninstall g_serial first and then install g_printer(also the closed and opened device files are different).
But the whole Linux system crashed at step 3 when it switches from USB Printer Mode to USB Virtual COM Mode, the log shows:
rmmod: can't unload module 'usb_f_printer': Resource temporarily unavailable
In addition, this Linux kernel is customized, after the system boots, the g_printer is automatically installed by the kernel, but the /dev/g_printer0 is not opened yet, so at this time, if I switch to USB Virtual COM Mode by using the steps above, it works with no errors(and the system won't crash of course), so it means I have another weird way to let the user switch between those two modes, that is when user wants to switch the mode, the system won't switch it immediately but save this selection in the configuration file, then it reboots the system, after the reboot, the program will check the configuration file to decide whether switches to USB Virtual COM Mode or just open /dev/g_printer0 to be ready for use. But this is too weird :(.
I can't kill this process because this is the only process running in this device, and also I can't exec another process to do this USB communication stuff because it's kind of wasting memory and computing resources.
So I have two questions:
Is there any way for the user to switch those two modes without rebooting the Linux system?
Does it means, once a process opens the /dev/g_printer0 device file, this driver can't be uninstalled but only reboot the system or kill the process? (even if I have already closed the opened device file)
Development platform: TI davinci processor with Linux OS
I am developing C program which receives user command over serial port and does the corresponding task. Basic task is to start and stop the video recording. And for retrieving the video to host pc from the embedded device, usb interface is used.
The partition used for storing the video file is loaded as USB gadget mass storage device using following kernel module for the user to save the video on host pc.
modprobe g_file_storage file=/root/usbstorage
But i want to load(or some otherway) this kernel module from the c function whenever user send a command to connect the embedded device to host. And disconnect whenever disconnect command is received.
As of now I'm able to load this module only from the shell.
Could any suggest any possible way of doing this from within the c-program.
I'm having an issue connecting a serial device to an embedded device I'm writing code for.
The device I am writing has two serial ports, an incoming from my laptop, and an outgoing to an external device.
When I connect both terminals to my laptop and view the data, I get exactly the data I am expecting.
When I connect my laptop to the external device directly, I am getting exactly what I expect, and a response.
When I connect the laptop and the external device to the embedded device I am working on, the laptop sends data to it, it receives it, it passes it on to the external device. This works as expected.
However, the external device doesn't send back the response.
If I send data to the external device from the embedded device, each new message I send allows it to send the original reply.
I know the first message got through correctly because the external device whirrs to live, and I know when it is sending the response by running and logic analyser on the tx/rx comms and viewing the traffic.
I considered that the embedded device is holding the rx line and preventing its transmission, but I don't see how that possible in the code. Also if that is the case it shouldn't work when I plug both lines into my laptop.
I also considered the DTR was not set high, but checked this and it appears to be set high.
Does anyone know a reason which would prevent a device from responding?
Note: When I say Serial Ports I am referring to the UART when referring to the embedded device. All device use a DB9 connector running RS232.
Edit: Operating System on laptop is Windows 10. Embedded device is a Atmega324p.
Edit 2: Did some more testing. It appears that it sometimes work and sometimes doesn't.
I have added an image which show a almost perfect signal of the response.
The blue section is a gap in the signal that shouldn't be there.
Ended up finding a solution.
The RTS line was held via the embedded device at 1.2v, while the Pc was holding it at 5.2v.
Pulling the RTS line up to 5v fixed the issue.
I want to use Bluetooth(4.0) on my board to transmit it's Name so any Mobile Application can see it's name and Mobile application initiates the pairing and connection with my Bluetooth.
I have seen some examples of Bluetooth(4.0) scanning nearby devices; For example:- It does scan for Bluetooth Mouser/Keyboard, but in this case Bluetooth(4.0) is in mode where it chooses the device it want to connect while I want it reverse so Any mobile application can see my Bluetooth and gets connect with it and does communication.
How can I put my Bluetooth(4.0) in such mode in Linux? Is there any C library using which I can put Bluetooth(4.0) is the mode where it goes in Bridge mode instead of scanning nearby devices?
You can set the name of your device like this:
hciconfig name "foo"
and check your name with:
hciconfig name
You also have to enable Low Energy advertising for your device to be found by others:
hciconfig leadv
You can configure your device to accept incoming connections like this (lm for link mode):
hciconfig lm MASTER,ACCEPT
This way the kernel will accept a connection, even if there are no listening sockets.
Considering you want to do actual communication, you would need to write a program, accepting the connection and sending/receiving data. Just putting your device in a mode where other devices can connect to it isn't really worth anything (because you can't communicate).
The basic principle is to open up an L2CAP socket, with the Channel ID of 4 (for Low Energy), then do standard bind/listen/accept. I suggest you look at the source code of Bluez and the examples.
I'm writing some code in C for an IrDA project on one win7 32bit computer. I have another computer setup to display any data received via in infrared. This part works. However the as soon as I connect the IrDA dongle to the PC, it starts to send periodic data for searching other IrDA devices. I want to disable this behavior programmatically so I see only the data sends as a result of my code. Anyone know which command to use? Is it WSASetService? I didn't learn socket programming, not sure what "removes from the registry a service instance within one or more namespaces. " really means. http://msdn.microsoft.com/en-us/library/windows/desktop/ms742211%28v=vs.85%29.aspx
Have you disabled the Infrared Monitor Service manually?
I experienced problems with this functionality in win7 when using Windows to communicating with an embedded micro-controller based device that worked well with windows XP.
I disabled the Infrared Monitor Service manually and found that windows was still polling the IrDA periodically!
I have not found any documentation available that describes it or how to disable it, I will continue searching...