From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joe Hershberger Date: Mon, 22 Jan 2018 18:54:57 -0600 Subject: [U-Boot] UDP packet sender In-Reply-To: <26be87ce-c4e3-ca14-9127-07b07fd919cb@gmail.com> References: <74a3f6f7-bd28-6676-ca49-8b9a26d3f93b@gmail.com> <26be87ce-c4e3-ca14-9127-07b07fd919cb@gmail.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit To: u-boot@lists.denx.de On Mon, Jan 22, 2018 at 5:28 PM, Gaëtan Carlier wrote: > Hi Joe, > > On 01/22/2018 11:46 PM, Joe Hershberger wrote: >> Hi Gaëtan, >> >> On Thu, Jan 18, 2018 at 4:56 AM, Gaëtan Carlier wrote: >>> Hi, >>> I would like to implement a new command and submit it to the mailing list. >>> The command will have the following format: >>> udpsend >>> >>> udpsend 255.255.255.255 4040 0 hello world >>> >>> If source port is 0, a random port will be used (11000 + (get_timer(0) % 4096)) >> >> I'd like to understand the purpose / use-case for this command? Maybe >> there is a more appropriate way to solve the problem you have instead. >> > > I want to send the current progression of an update script. As the board has no display/leds, the only way to get update progression is to broadcast UDP packet that a PC software will monitor. U-Boot will load/source a script from an ext4 partition. This script will load a rootfs image from update partition of an eMMC splitted into 10M chunks that will be written to an other partition of the eMMC. > This is for update on site (by customer). > > This UDP command will also be used in a closed production LAN to send Unique ID of the CPU (secret) and the MAC address to the monitoring production (burning) software that will feed a database to be able to generate license keys linked to hardware and print a label with the product name and the MAC address. > > Maybe there is already existing command that I can use from a U-Boot script ? I think this is commonly done by enabling netconsole and controlling / monitoring progress based on console output sent over UDP. Cheers, -Joe >>> Where do I have to place my code : cmd or net directory ? >>> For me cmd will be the better directory to keep it away from all more complex stuff like DHCP, TFTP, ... >> >> That's probably true. cmd/ would be the appropriate place. >> >> -Joe >> > > Regards, > Gaëtan