×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Aug 2007
    Posts
    34

    UDP broadcast not working (Asha 310)

    Hello!

    I'm trying to broadcast a UDP package (datagram) but can't get it to work on the device (Asha 310). Here is my code:

    Code:
      UDPDatagramConnection conn = (UDPDatagramConnection) Connector.open("datagram://");
      System.out.println("Local address " + conn.getLocalAddress() + ":" + conn.getLocalPort());
    				
      Datagram dg = conn.newDatagram(pPacket.length);
      dg.setData(pPacket, 0, pPacket.length);
      dg.setAddress("datagram://192.168.0.255:1234");
    
      conn.send(dg);
    If I use concrete address (e.g. 192.168.0.2) the packet is send without problems. If I use 255.255.255.255, conn.send() finishes without exception but nothing gets send on the network (checked with Wireshark). If the address is using the correct format to broadcast just in this network segment as above (192.168.0.255), conn.send() throws "Failed to send datagram" exception.

    In the simulator 255.255.255.255 still does not work but 192.168.0.255 works just fine. However on the device nothing works (except sending to a concrete, non-broadcast address). Any clues? Is the UDP broadcast possible at all on Asha devices?

    Thanks in advance.

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,751

    Re: UDP broadcast not working (Asha 310)

    Are your PC and your device using the same network? 192.168.0.255 is the broadcast address for 192.168.0.0/8. If your phone uses a different network, the address is also different.
    EDIT: Ok, I see you mention it in the middle.

  3. #3
    Registered User
    Join Date
    Aug 2007
    Posts
    34

    Re: UDP broadcast not working (Asha 310)

    Yes, the phone is connected via Wi-Fi to the same network and the subnet mask is 255.255.255.0, so the broadcast address is 192.168.0.255. It seems like a firmware bug/limitation in S40 phones.

Similar Threads

  1. Nokia Debug Device not working for Asha 205
    By trivedikamal123 in forum Mobile Java Tools & SDKs
    Replies: 1
    Last Post: 2013-04-16, 15:43
  2. Full screen mode is not working in ASha(java)
    By ohiletechguy in forum Mobile Java General
    Replies: 1
    Last Post: 2013-03-28, 09:14
  3. Broadcast FM
    By franci102 in forum General Development Questions
    Replies: 4
    Last Post: 2007-12-17, 06:03
  4. broadcast SMS
    By amisexy in forum PC Suite API and PC Connectivity SDK
    Replies: 1
    Last Post: 2003-06-25, 17:05

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×