Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
Let's say hypothetically that I have 3 devices that are all compatible and Bluetooth enabled.
Device #1 - A fitness watch of some kind that you wear on your wrist.
Device #2 - Arbitrary state device with master/slave BT chip(s)
Device #3 - Bluetooth enabled lights / decorations
Pairings:
Device #1 <-> Device #2
Device #2 <-> Device #3 (multiple of them throughout a room, maybe 5 or 6 Device3's)
Is there a way/easy way/accepted way to repeat the signal from #1 to all the #3s? I was hoping #2 could act as a hub maintaining state, but let the Bluetooth signal pass straight through to all the #3s (without #1 needing to directly connect to all the #3s individually).
What would be the best way to approach this kind of situation?
I think what I'm basically describing is like an Ethernet switch but for Bluetooth.
The short answer is "no", there is not an easy or standard way to do this. What you are looking for would be a Bluetooth repeater. Bluetooth repeater devices do exist, but are proprietary, not standardized. For example, this one from a German solar power manufacture, specific to their devices.
Usually, Bluetooth networks are a simple star topology with a single master and one or more slaves - a piconet. However, it is possible to join multiple piconets into a larger scatternet.
The longer answer is that it is possible, but will require software support from Device #2. That may involve custom software or firmware development. Depending on your application, it may be simpler to consider adding another form of wireless connectivity into the system, such as wireless Ethernet.
This may not be quite what you're looking for, but Aircable claims to have a device that will extend your Bluetooth range. I haven't tried it, but there's a review of an older version that indicates that it does work, though perhaps not as well as it claims. There's a (newer?) version available on Amazon.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I've tried searching Google and was wondering what language microcontrollerare programmed in? Can you use Java? Like say on an amplifier you have a menu to increase or lower bass and treble, displaying firmware version and so on. I'm assuming they would be flashed with a special tool.
Also is Java or C++ the better language?
I notice that you are still relatively new to the subject. Unfortunately, I can't give you a direct answer, because the topic of hardware-oriented programming on embedded systems is a very deep and complex topic in computer science.
But in general: When programming microcontrollers (or microchips, as you call them) there is usually not much object-oriented programming. Things like generic programming styles etc. you search in vain. The rule is: lean, fast and direct languages that allow a reasonable amount of freedom in programming (e.g. C, C++) are used here. Java (or C#, if the architecture with .Net Frameworks allows it at all) are not suitable for this.
But this does not mean that it is not possible to develop such applications with Java and C#. I had the pleasure to write a highly available application in C# for a microcontroller. This is possible, but not pleasant.
If you want to get first impressions in this field of computer science, I recommend to buy a Raspberry Pi and develop your first programs on it. Based on this you can then add additional hardware and program it (e.g. an LCD display or a few sensors). From then on you can jump to other microcontrollers (like the STM32).
Greetings
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I have just been refreshing my networking knowledge and came across a question regarding packet (segments, frames .. does not matter really).
There are many diagrams of the packet or segment header on the internet and its quite understandable. How are but these fields ordered in a binary stream flowing through cable and how does translator figure out that one packet has ended and another begins while just receiving ones and zeros?
Thanks
Understanding this requires understanding the OSI 7 layer model.
If you want to specifically talk about data flowing through a cable, and assuming you mean TCP/ IP data over Ethernet, then Ethernet is a layer 1 & layer 2 protocol. How the data is physically transmitted depends on whether it's full or half duplex, whether it's 8 wire, 4 wire or 2 wire (though 2 wire protocols are propriety like EtherCAT) and other such physical transmission concerns. Typically, a PHY chip sits at either end of a cable and passes up Layer 2 data to some kind of MAC layer.
Anyway, getting to the point regarding when does a listener know when a packet starts and finishes, the ethernet protocol defines a 7 byte preamble and start of frame delimiter and a 4 byte Frame Check Sequence. You can read more about it here.
Software to process packets that runs on a CPU will typically never see any of that though. Ethernet frames will pass their payloads into a buffer where it will be stored sequentially until it's read or overwritten.
Simply to say, one of the Protocol in handling these process is TCP (Layer 4) protocol, which sends the split data with index as 0,1,2,3 and in receiving side obviously it may receive in order 3,1,0,2 or in order 1,2,0,3 or any other but the TCP append data by index
I explain in Layman point
Study about the OSI Reference Model and Networking basics
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
so ive read this post here: and im a bit confused, so here's my additional question:
how does UDP handle data which are lost? because it says there that UDP doesn't care if the data will arrive to the destination or the ordering of data.
SO example in an on line game, how does UDP handle data loss? my understanding is that when a data is lost so lets say my character's hand cant be seen in an on line game? or the warglaive of azinoth which i farmed for years is lost? LOL
and if the ordering is not important so lets say i the head of my character will be messed up or the body will be dislocated, something like that.
So can anyone clarify this for me?
A better example of UDP in gaming is for position information.
In this case the position of a character is sent several times a second and it doesn't matter whether a packet is lost as another one will be sent again shortly. When you combine this with a game engine that does some level of interpolation and extrapolation then you can achieve smooth looking motion from sporadic data.
In the case of re-ordering if you receive a character position which is older (in time) due to packet re-ordering you would just discard it as you've already got a newer value.
With your example of loot - it's possible this information is sent via TCP or using a reliable wrapper around UDP - to your client.
Take a look at http://code.google.com/p/lidgren-network-gen3/ for a C# UDP networking library which is designed with games in mind. It provides various unreliable and reliable channels over UDP and should give you an idea how UDP is typically used in games.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I know it's possible to modify the IP headers and change the source IP address, but it should be simple for network devices to detect and discard those messages. If they don't, why not? Does it add too much overhead?
The industry name for the feature you are asking about is called "Unicast Reverse Path Forwarding" (or as Cisco calls it, "uRPF"); it is defined in RFC 3704 and is considered a Best Current Practice (see BCP38).
Speaking at a very high level, most of the hardware used by ISPs has this feature built into an ASIC; normally there is not a huge penalty for turning it on. Sometimes there are feature conflicts, but again this is not a huge deal in most cases.
The biggest reason it isn't universal is because the internet is still somewhat like the American "wild west" in the 1800s; consider them analagous to a town's sheriff. The policies and competency of the engineering/operational personnel varies, and many ISPs are too busy with making things "work" that they don't have cycles to make things "work well".
That dynamic is particularly true in smaller countries; I worked for a large network equipment manufacturer in a previous life and occasionally traveled throughout southeast asia conducting ISP seminars. Smaller countries are often half a decade (or more) behind the practices and competency of ISPs here in the US (that's not to say that US ISPs are terribly great on the whole either, but they are generally much better off than, say, some of the ISPs operating in the smaller islands in the Pacific).
This results in the non-trivial amount of spamming / hacker traffic on the internet today... it's there because they have no lack of places to hide. Source IP address spoofing is one of their first lines of defense.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I'm looking for the best way to interpret the standard (well, standardish) Ethernet PHY registers, to determine the speed that an Ethernet link is actually running at. (e.g. 10/100/1000 and full/half-duplex)
I daresay that this is to be found in the source of things like Linux, and I'm just off to look there now, but if anyone has a good reference I'd be interested.
What I'm interested in is if it actually linked and what it linked at, rather than the vast sea of possibilities that each end has advertised at the outset.
Thanks for the answer. It's intended as a language and platform agnostic question, because pretty much all MII/GMII Ethernet PHYs have the same basic registers. I happen to be on an embedded platform.
But I found a sensible sequence which was good enough for my restricted application by looking at various bits of Linux driver source - it's basically:
Check for link-up in basic-status (0x1)
If the link's up then check for negotiation-complete in basic status (0x1)
If the negotiation's complete then check for 1G in the 1000M-status register (0xa)
If you've not got 1G, then you've got 100M. (That's not a general rule, but it applies in this application)
Maybe this was really a hardware question rather than a software one...
To help you looking at how the Linux kernel does it: While each driver can do its own thing, there is a generic version which is supposed to be used when the chip follows the standard closely enough: Generic Media Independent Interface device support.