XCP MC ECU Connect code-301096

It is a similar problem to

http://forums.NI.com/T5/automotive-and-embedded-networks/XCP-connection-problem/m-p/905869/highlight...

but the solution is not the same.

I want to connect to an ECU via XCP.  XCP communication properties are stored in the a2l file, so I did not specify their in my VI.

Protocol and interface is XCP:CAN0

Comm properties are listed here:

I just can't understand why it does not connect.

versions:

LV 13 SP1

NI-CAN 15.0

ECU M & C 2.3.1

Any ideas on what to check or try?

Thank you!

Ok!

It works.  I hate to admit it, but I was on the wrong CAN wear.  There are 3 on this calculator: Group power train, diagnostic and sensor.

I did, however, add to this port 120 Ohm resistance, as the original port had this termination, but not one that I really needed.  So thank you JefeL for repeat; Although he was not the solution, he helped to save time.

Tags: NI Products

Similar Questions

  • necessary to use the recovery for each connection code

    Hello

    I have an i - mac OS X El Capitan(21.5"year 2012 w/ 2.7 ghz Intel Core i5, 8gb (non removable or upgradable) @1600 mhz ddr3")

    I can no more connection in without using my recovery code.  even after I reset password and Keychain Access, once the machine goes to sleep and I have to log in again, the new password does not work.

    I suspect that it became a problem subsequently one of the OS X El Capitan updates goes wrong?  Nevertheless, the recovery code was left on my desktop and copied its employees several possible.

    I can change the code or is there a solution to my problem?

    Thank you!

    Pete

    You use FileVault to encrypt the boot on your iMac disk?

  • When you connect to the internet error code 678 appears. What can I do to fix this?

    I get the error code 678 when trying to connect to the internet.

    With the help of a new modem D-Link DSL provided for me by my new extreme DSL service provider.

    Have Windows XP Professional installed on my machine.

    I downloaded the updated drivers for my network n-force Nvidia card.
    When I try to connect to the internet, I receive error 678 and cannot connect code.

    A run scans regularly for any virus or malware, with none detected using Norton 360.
    In addition to performing other troubleshooting code error 678.
    How can I fix this error 678?
      
    Hello
    You can check this link:
    You may receive error 678 or error 769 when you try to connect to the Internet or when you try to browse the Internet after you install Windows XP Service Pack 2
  • Printer requires an access code to the user instead of windows and password connection?.

    I was see the printers to HP asking (LaserJet M4555 MFP color LaserJet 500 MFP M575 etc.) for access instead of windows and password connection code.

    One thing I noticed, is that when this happens there is a slight change in the EWS page configuration to security-access control >. The device administrator tabe is off, as you can see below ehen what happens

    Tried cold reset the printer and restore settings, but it does not work and some thimes it works for awhile but the problem has returned.

    We should not promt instead access code we need to connect normal windows and used password be there originally.

    The current configuration on your screen shows that the method, on the last column in the table header, log by default is set to the Local device. All permissions are also set using the default method ('use default' in the column 'Sign In method').

    In order to use the Windows authentication method, you must configure the sign 'Windows' in the method on the section above:

    Then set the default value 'Sign in the method' of the table of authorities 'Windows '.

    Kind regards

    Eduardo_G

  • How to put in place of the daq hardware several lists on a shield with ecu mc toolkit?

    Anyone has the pleasure to set up multiple lists on an ECU data acquisition?

    I use MC Addon for Labview ECU 2011.  I can successfully a single list of acquisition of configuration data and read the data correctly.  This method uses the DAQ list mode to initialize instead of polling, it really cuts down ensuring CAN.

    I do not have my VI on this PC, but it's basically ECU Connect > initialize ECU DAQ list (sample rate and channel list sets) > ECU transmit DAQ list to ECU > DAQ Start list > LOOP {ECU read}

    I need to create a second list for the acquisition of data to sample at a different pace.  Any ideas?

    Thank you

    Ben

    I continued to play with the read command and finally successful initialization to do work.

    Sorry for the rough state of the son, but I just got to run :-)

  • claim want 5530 code

    How can I get request like 5530 with usb connection code? I don't have a wireless connection. I followed the instructions, if you have wireless and never found the statement "I agree."

    Hello

    Well, the printer doesn't have any LAN port. How you connect your computer to the internet today? What is your modem? If you need only to print via a USB port, then connect it to your computer via a USB port otherwise you need a wireless router.

    Kind regards.

  • Unable to connect to a network error: DNS server does not

    * Original title: unable to connect to the internet - yellow on network acess exclamation point

    other computers, my ipad and phone can all access the internet via the same wifi connection.

    even a direct lan connection did not help

    shows of troubleshooting DNS server does not

    Help, please

    concerning

    Turkish Lira

    Hello

    Thanks for posting your query on the Microsoft Community.

    According to the description of the problem, I understand that you can not connect to the network on your computer.

    I can understand how frustrating it can be when things do not work as expected.

    To better understand this issue, I would like to know the following information:

    1. What is the brand and model of the computer?

    2. did you of recent changes to the computer before this problem?

    3. you receive an error during the network connection code failed?

    DNS (Domain Name System) translates the URL in IP (Internet Protocol) addresses (and vice versa). For example, if you type http://www.microsoft.com into the address bar in your web browser, your computer sends a request to a DNS server. The DNS server translates the URL to an IP address so that your computer can find the Microsoft web server.

    We will try the following methods and check if it helps.

    Method 1: I suggest you clear the DNS cache and see if that fixes the problem. Clear the DNS cache forces DNS to query a DNS server rather than using the information stored in the cache.

    Follow these steps:

    a. click on the 'Start' button.

    b b.. in the search box, type "command prompt"

    c. in the list of results, click on invite and then click on run as administrator

    If you are prompted for an administrator password or a confirmation, type the password or provide confirmation.

    d. at the command prompt, type ipconfig/flushdns

    Restart the computer and see if that fixes the problem.

    Method 2: If you still have questions, I suggest you refer to the suggestions of Meghmala responded on 28 June 2011 from the link below.

    http://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-networking/DNS-server-not-responding-keeps-coming-up-and-i/58fc8366-B2B2-4A8D-9E30-56a155635631?rtAction=1422395012673

    You can also see the following article for more information:

    How can I troubleshoot network card?

    http://Windows.Microsoft.com/en-us/Windows7/fix-network-adapter-problems

    Hope this information helps, please respond with the requested information and the status of the question to get help. We will be happy to help you.


  • Strange connection problem

    This happens on the Simulator and the current device.  I did it on 8800, 8703e, 8320 and 7100i.  OS 4.1 and 4.2.  Also tried on multiple media.  Tried with and without a BES.

    I am able to create an http connection initially, and everything works fine.  I log in, I get my data.  Large.

    However, when I leave my application and go to the Blackberry Desktop and turn the Wi - Fi market then re - enter my app and try to make the same connection, it will not work.

    When you run the debugger, it seems to try and make the ' status int = httpConn.getResponseCode (); »

    line of code and won't go further.  It will be expire.  In fact, he gets caught by the try catch statement.  The Exception toString is ' java.io.InterruptedIOException: Local connection timed out after ~ 120000'

    My connection code is...

         StreamConnection s = null;      String finalUrl = "";       finalUrl = "http://" + login.url + directoryPath + filename + local.getUrlPlus();       try {           s = (StreamConnection) Connector.open(finalUrl);            HttpConnection httpConn = (HttpConnection) s;           httpConn.setRequestMethod(HttpConnection.POST);         httpConn.setRequestProperty("user-agent", "BB DOC");            httpConn.setRequestProperty("content-type", "application/x-www-form-urlencoded");           httpConn.setRequestProperty("connection", "close");         byte d[] = data.getBytes();         httpConn.setRequestProperty("content-length", Integer.toString(d.length));          OutputStream os = s.openOutputStream();         os.write(d);            if (os != null)             os.close();         int status = httpConn.getResponseCode();            if (status == HttpConnection.HTTP_OK) {             InputStream input = s.openInputStream();                //parses the content returned               input.close();          } else {                ;//Had a server connection problem                      }           s.close();          httpConn.close();       } catch (IOException e) {                   ;//Catches the timeout here.        }
    

    Seems the only way to solve this problem is to restart the Simulator.

    Only occurs when the wireless is displayed/hidden market.  Sound like something not be reset or something.  I have simulated this when the unit is made of coverage and brought back in coverage, but the error never occurred.  Only when the wireless is turned on and the.

    What of even weirder, is that I have been using the same connection code for over a year without any problems.

    Someone at - he already experienced this?  Its driving me crazy.

    Any help would be more then appreciated.  Thank you!

    This seems to be a matter of BlackBerry Simulator.  I was able to reproduce and checked that it has been fixed in version 4.3.0 the BlackBerry Simulator.

  • Simple HTTP (POST) connection

    I have the code below, it connects to the correct php page, but the POST data is not getting through.

    It's probably a syntax problem, but I can't get out.

    If you need anything else to help study, just let me know.

    Thank you

    public void sendPostRequest() {
            HttpConnection hc = null;
            try {
    
                hc = (HttpConnection)Connector.open("http://www.example.com/index.php"+updateConnectionSuffix());
                URLEncodedPostData oPostData = new URLEncodedPostData(URLEncodedPostData.DEFAULT_CHARSET, false);
                oPostData.append("lat", "100");
                oPostData.append("long", "200");
                OutputStream strmOut = hc.openOutputStream();
                strmOut.write(oPostData.getBytes());
                strmOut.flush();
                strmOut.close();
                int blah = hc.getResponseCode();
                String returnMessage = hc.getResponseMessage();
    
            }
    
            catch (IOException ioe) {
    
            }
            finally {
                try {
                    if (hc != null) hc.close();
                } catch (IOException ignored) {}
            }
    }
    
    private String updateConnectionSuffix(){
            String connSuffix = null;
            if (DeviceInfo.isSimulator()) {
                connSuffix = ";deviceside=true";
            } else {
                if ( (WLANInfo.getWLANState() == WLANInfo.WLAN_STATE_CONNECTED) &&
                        RadioInfo.areWAFsSupported(RadioInfo.WAF_WLAN)) {
                    connSuffix=";interface=wifi";
                } else {
                    String uid = null;
                    ServiceBook sb = ServiceBook.getSB();
                    ServiceRecord[] records = sb.findRecordsByCid("WPTCP");
                    for (int i = 0; i < records.length; i++) {
                        if (records[i].isValid() && !records[i].isDisabled()) {
                            if (records[i].getUid() != null &&
                                    records[i].getUid().length() != 0) {
                                if ((records[i].getCid().toLowerCase().indexOf("wptcp") != -1) &&
                                        (records[i].getUid().toLowerCase().indexOf("wifi") == -1) &&
                                        (records[i].getUid().toLowerCase().indexOf("mms") == -1) ) {
                                    uid = records[i].getUid();
                                    break;
                                }
                            }
                        }
                    }
                    if (uid != null) {
                        // WAP2 Connection
                        connSuffix = ";ConnectionUID="+uid;
                    } else {
                        connSuffix = ";deviceside=true";
                    }
                }
            }
            return connSuffix;
        }
    
    }
    

    Agree with RexDoug, and above all, you don't actually tell the http connection this is a POST.

    You will find several examples of ribust code here:

    http://supportforums.BlackBerry.com/T5/Java-development/sample-HTTP-connection-code-and-bis-B-access...

    Here are a few additional lines, you will need;

    hc.setRequestMethod (HttpConnection.POST);
    hc.setRequestProperty (HttpProtocolConstants.HEADER_CONTENT_TYPE, oPostData.getContentType ());
    postBytes Byte [] = oPostData.getBytes ();
    hc.setRequestProperty (HttpProtocolConstants.HEADER_CONTENT_LENGTH, Integer.toString (postBytes.length));
    OutputStream strmOut = hc.openOutputStream ();
    strmOut.write (postBytes);
    strmOut.flush ();
    strmOut.close ();

  • Connection on BIS

    Hey all,.

    I have a question. Is it possible that a BB device is only connect via BIS of the carrier. A client of me tells me that the application is unable to connect. And do not use BIS because I'm not a member of the alliance. What can I do? What should I tell him, that he may not use the app or need WAP?

    Everyone understands what I mean and can help me?

    Kind regards

    I'm not sure that there is a general answer to your query. All carriers in this country (UK) who offer data plans will WAP and direct TCP, so anyone in the United Kingdom should be able to run an application properly written BlackBerry, using the direct TCP or WAP and get data that him.  But I understand that Vodafone India does not offer a data rate, or at least not a version that includes direct TCP or WAP.

    So you could go back to that customer and ask them to get their business if they support WAP or direct TCP.  Because if they do, your application can connect using one of these methods.

    Another option is explained in this thread:

    http://supportforums.BlackBerry.com/T5/Java-development/sample-HTTP-connection-code-and-bis-B-access...

  • Redirect 302 get only when connected via BES loop

    Hello

    I have a problem when I am connected via BES, I get a server redirection loop (it returns a 302 with the originial URL response in the "location" header field). When it is connected via the BIS-B, WiFi or carrier, the server returns redirects as expected and the app works. However I require a BES connection and him give a priority when they are available.

    Note that I checked the connection returned by Networking.java string is correct (we add ";) (deviceside = false' when BES is to be using).

    Here's the network code I use:

    package [redacted]
    
    /*
     * Networking.java
     *
     * This code is based on the connection code developed by Mike Nelson of AccelGolf.
     * http://blog.accelgolf.com/2009/05/22/blackberry-cross-carrier-and-cross-network-http-connection
     *
     */
    
    import net.rim.device.api.system.CoverageInfo;
    import net.rim.device.api.system.DeviceInfo;
    import net.rim.device.api.system.WLANInfo;
    
    public class Networking
    {
        Networking()
        {
        }
    
    // Whether or not to the simulator should use MDS to connect.
    // By default this should be false, however if you are testing
    // in an environment where MDS will be the expected connection method,
    // set this to true to have the simulator attempt to use MDS.  This variable
    // has no effect on what happens on a real device.
        private static final boolean isMDS = false;
    
        // the timeout
        public static final int TIMEOUT = 30000;
    
        /**
         * Determines what connection type to use and returns the necessary string
         * to use it.
         *
         * @return A string with the connection info
         */
        public static String getConnectionString()
        {
    
            String connectionString = null;
    
            // Simulator behavior is controlled by the USE_MDS_IN_SIMULATOR variable.
            if (DeviceInfo.isSimulator())
            {
                if (isMDS)
                {
                    connectionString = ";ConnectionTimeout=" + TIMEOUT + ";deviceside=false";
                }
                else
                {
                    connectionString = ";ConnectionTimeout=" + TIMEOUT + ";deviceside=true";
                }
            }
    
            // Check for an MDS connection instead (BlackBerry Enterprise Server)
            else if ((CoverageInfo.getCoverageStatus() & CoverageInfo.COVERAGE_MDS) == CoverageInfo.COVERAGE_MDS)
            {
                System.out.println("MDS coverage found");
                connectionString = ";ConnectionTimeout=" + TIMEOUT + ";deviceside=false";
            }
    
            else if ((CoverageInfo.getCoverageStatus() & CoverageInfo.COVERAGE_BIS_B) == CoverageInfo.COVERAGE_BIS_B)
            {
                // otherwise, use the Uid to construct a valid carrier BIS-B request
                System.out.println("Using BIS");
                connectionString = ";ConnectionTimeout=" + TIMEOUT + ";deviceside=false;ConnectionType=[redacted]";
            }
    
            // Wifi is the preferred transmission method
            else if (WLANInfo.getWLANState() == WLANInfo.WLAN_STATE_CONNECTED)
            {
                System.out.println("Using WIFI");
                connectionString = ";interface=wifi";
            }
    
            // Is the carrier network the only way to connect?
            else if ((CoverageInfo.getCoverageStatus() & CoverageInfo.COVERAGE_DIRECT) == CoverageInfo.COVERAGE_DIRECT)
            {
    
                // Has carrier coverage, but not BIBS.  So use the carrier's TCP network
                System.out.println("Device is connected Direct");
                connectionString = ";ConnectionTimeout=" + TIMEOUT + ";deviceside=true";
    
            }
    
            // If there is no connection available abort to avoid bugging the user unnecssarily.
            else if (CoverageInfo.getCoverageStatus() == CoverageInfo.COVERAGE_NONE)
            {
                System.out.println("There is no available connection.");
            }
    
            // In theory, all bases are covered so this shouldn't be reachable.
            else
            {
                System.out.println("no other options found, assuming device.");
                connectionString = ";ConnectionTimeout=" + TIMEOUT + ";deviceside=true";
            }
    
            return connectionString;
        }
    }
    

    Here is sendRequest managed the connection method and the redirection:

    public HttpResponse sendRequest(HttpRequest request)
        {
            String url = request.getUrl();
            if (url == null)
            {
                HttpResponse result = new HttpResponse();
                result.responseCode = 404;
                result.responseMessage = "Not Found";
                return result;
            }
    
            ConnectionWrapper cw = connectionWrapperForRequest(request);
            if (cw == null)
            {
                return null;
            }
    
            boolean compressionEnabled = !request.disableCompression() && COMPRESSION_ENABLED;
    
            HttpResponse result = new HttpResponse();
            try
            {
                String finalURL = url.trim() + Networking.getConnectionString();
                cw.connection = (HttpConnection) Connector.open(finalURL, Connector.READ_WRITE, false);
                System.out.println("Connection string: " + Networking.getConnectionString());
                System.out.println("Full connec.  URL: " + finalURL);
    
                if (cw.connection == null)
                {
                    result.errorMessage = "Could not open a network connection.";
                    result.completedWithError = true;
                    return result;
                }
    
                cw.connection.setRequestMethod(request.getHttpMethod());
    
                if (compressionEnabled)
                {
                    cw.connection.setRequestProperty("Accept-Encoding", "gzip");
                }
    
                cw.connection.setRequestProperty("User-Agent",
                        "" + DeviceInfo.getManufacturerName() + "/" + DeviceInfo.getDeviceName() + "/" + Config.getVersionNumber());
                if (request.username() != null)
                {
                    cw.connection.setRequestProperty("Authorization", "Basic " + Utils.base64Encode(request.username() + ":" + request.password()));
                }
    
                // set this header so BES servers will not change the content of the headers
                cw.connection.setRequestProperty("x-rim-transcode-content", "none");
    
                //add cookies
                if (HttpCookieJar.getInstance().cookieCount() > 0)
                {
                    cw.connection.setRequestProperty("Cookie", HttpCookieJar.getInstance().getCookiesAsString());
                }
    
                //pull request headers from HttpRequest
    
                Hashtable headers = request.getHeaders();
                for (Enumeration e = headers.keys(); e.hasMoreElements();)
                {
                    String key = (String) e.nextElement();
                    cw.connection.setRequestProperty(key, (String) headers.get(key));
                }
    
                byte[] upstreamBytes = request.requestBytes();
                if (upstreamBytes != null && upstreamBytes.length > 0)
                {
                    Logger.getLogger().log(new String(upstreamBytes));
                    cw.connection.setRequestProperty(HttpProtocolConstants.HEADER_CONTENT_TYPE,
                            HttpProtocolConstants.CONTENT_TYPE_APPLICATION_X_WWW_FORM_URLENCODED);
                    cw.connection.setRequestProperty(HttpProtocolConstants.HEADER_CONTENT_LENGTH, String.valueOf(upstreamBytes.length));
                    cw.outputStream = cw.connection.openOutputStream();
                    cw.outputStream.write(upstreamBytes);
                }
    
                Logger.getLogger().log("Get response");
    
                result.responseCode = cw.connection.getResponseCode();
                result.responseMessage = cw.connection.getResponseMessage();
    
                Logger.getLogger().log("Status Code: " + result.responseCode);
                Logger.getLogger().log("Status Message: " + result.responseMessage);
    
                //suck out the cookies here
                int fieldNo = 0;
                String headerField;
                while ((headerField = cw.connection.getHeaderField(fieldNo)) != null)
                {
                    if (cw.connection.getHeaderFieldKey(fieldNo).equals("Set-Cookie"))
                    {
                        HttpCookieJar.getInstance().setCookie(headerField);
                    }
                    fieldNo++;
                }
    
                System.out.println("get redirect");
    
                //get redirect location
                String location;
                if ((location = cw.connection.getHeaderField("Location")) != null)
                {
                    if (location == url.trim())
                    {
                        Logger.getLogger().log("Redirect loop");
                    }
                    Logger.getLogger().log("Redirect: " + location);
                    result.redirectLocation = location.trim();
                }
                else
                    result.redirectLocation = null;
    
                byte[] buffer = new byte[HTTP_BUFFER_SIZE];
                int count;
    
                System.out.println("compression");
    
                cw.inputStream = cw.connection.openInputStream();
                if (compressionEnabled)
                {
                    String encoding = cw.connection.getEncoding();
                    if ("gzip".equalsIgnoreCase(encoding))
                    {
                        cw.inputStream = new GZIPInputStream(cw.inputStream);
                    }
                }
    
                cw.inputStream = new DataInputStream(cw.inputStream);
    
                System.out.println("output stream");
    
                ByteArrayOutputStream out = new ByteArrayOutputStream();
                try
                {
                    while ((count = cw.inputStream.read(buffer)) >= 0)
                    {
                        out.write(buffer, 0, count);
                    }
                    result.bytes = out.toByteArray();
                }
                finally
                {
                    out.close();
                }
                cw.close();
                Logger.getLogger().log("Response complete");
            }
            catch (IOException e)
            {
                result.errorMessage = e.getMessage();
                result.completedWithError = true;
                Logger.getLogger().log("ERROR!:" + e.getMessage());
            }
            finally
            {
                removeConnectionWrapper(cw);
            }
            return result;
        }
    

    Here's the whole HttpService.java for the context of the SendRequest method above:

    //#preprocess
    
    //package
    //imports
    
    public class HttpService
    {
        private static HttpService _instance;
    
        private static final boolean COMPRESSION_ENABLED = false;
        private static final int HTTP_BUFFER_SIZE = 1024;
    
        public static synchronized HttpService instance()
        {
            if (_instance == null)
            {
                _instance = new HttpService();
            }
            return _instance;
        }
    
        private WorkQueue _requestQueue = new WorkQueue(1024, 4);
        private Hashtable _connections = new Hashtable(10);
    
        private HttpService()
        {
            // singleton
        }
    
        private ConnectionWrapper connectionWrapperForRequest(HttpRequest request)
        {
            ConnectionWrapper cw = null;
            synchronized (request)
            {
                if (!request.cancelled())
                {
                    cw = new ConnectionWrapper(request);
                    synchronized (_connections)
                    {
                        _connections.put(request, cw);
                    }
                }
            }
            return cw;
        }
    
        private void removeConnectionWrapper(ConnectionWrapper cw)
        {
            synchronized (_connections)
            {
                _connections.remove(cw.request);
            }
            cw.close();
        }
    
        public void cancelRequest(HttpRequest request)
        {
            ConnectionWrapper cw = null;
            synchronized (request)
            {
                synchronized (_connections)
                {
                    cw = (ConnectionWrapper) _connections.remove(request);
                }
                request.setCancelled();
            }
            if (cw != null)
            {
                cw.close();
            }
        }
    
        public void executeRequest(final HttpRequest request)
        {
            _requestQueue.addWorkItem(new Runnable()
            {
                public void run()
                {
                    HttpResponse response = sendRequest(request);
                    if (!request.cancelled() && response != null)
                    {
                        request.completeRequest(response);
                    }
                };
            });
        }
    
        public HttpResponse sendRequest(HttpRequest request)
        {
            String url = request.getUrl();
            if (url == null)
            {
                HttpResponse result = new HttpResponse();
                result.responseCode = 404;
                result.responseMessage = "Not Found";
                return result;
            }
    
            ConnectionWrapper cw = connectionWrapperForRequest(request);
            if (cw == null)
            {
                return null;
            }
    
            boolean compressionEnabled = !request.disableCompression() && COMPRESSION_ENABLED;
    
            HttpResponse result = new HttpResponse();
            try
            {
                String finalURL = url.trim() + Networking.getConnectionString();
                cw.connection = (HttpConnection) Connector.open(finalURL, Connector.READ_WRITE, false);
                System.out.println("Connection string: " + Networking.getConnectionString());
                System.out.println("Full connec.  URL: " + finalURL);
    
                if (cw.connection == null)
                {
                    result.errorMessage = "Could not open a network connection.";
                    result.completedWithError = true;
                    return result;
                }
    
                cw.connection.setRequestMethod(request.getHttpMethod());
    
                if (compressionEnabled)
                {
                    cw.connection.setRequestProperty("Accept-Encoding", "gzip");
                }
    
                cw.connection.setRequestProperty("User-Agent",
                        "" + DeviceInfo.getManufacturerName() + "/" + DeviceInfo.getDeviceName() + "/" + Config.getVersionNumber());
                if (request.username() != null)
                {
                    cw.connection.setRequestProperty("Authorization", "Basic " + Utils.base64Encode(request.username() + ":" + request.password()));
                }
    
                // set this header so BES servers will not change the content of the headers
                cw.connection.setRequestProperty("x-rim-transcode-content", "none");
    
                //add cookies
                if (HttpCookieJar.getInstance().cookieCount() > 0)
                {
                    cw.connection.setRequestProperty("Cookie", HttpCookieJar.getInstance().getCookiesAsString());
                }
    
                //pull request headers from HttpRequest
    
                Hashtable headers = request.getHeaders();
                for (Enumeration e = headers.keys(); e.hasMoreElements();)
                {
                    String key = (String) e.nextElement();
                    cw.connection.setRequestProperty(key, (String) headers.get(key));
                }
    
                byte[] upstreamBytes = request.requestBytes();
                if (upstreamBytes != null && upstreamBytes.length > 0)
                {
                    Logger.getLogger().log(new String(upstreamBytes));
                    cw.connection.setRequestProperty(HttpProtocolConstants.HEADER_CONTENT_TYPE,
                            HttpProtocolConstants.CONTENT_TYPE_APPLICATION_X_WWW_FORM_URLENCODED);
                    cw.connection.setRequestProperty(HttpProtocolConstants.HEADER_CONTENT_LENGTH, String.valueOf(upstreamBytes.length));
                    cw.outputStream = cw.connection.openOutputStream();
                    cw.outputStream.write(upstreamBytes);
                }
    
                Logger.getLogger().log("Get response");
    
                result.responseCode = cw.connection.getResponseCode();
                result.responseMessage = cw.connection.getResponseMessage();
    
                Logger.getLogger().log("Status Code: " + result.responseCode);
                Logger.getLogger().log("Status Message: " + result.responseMessage);
    
                //suck out the cookies here
                int fieldNo = 0;
                String headerField;
                while ((headerField = cw.connection.getHeaderField(fieldNo)) != null)
                {
                    if (cw.connection.getHeaderFieldKey(fieldNo).equals("Set-Cookie"))
                    {
                        HttpCookieJar.getInstance().setCookie(headerField);
                    }
                    fieldNo++;
                }
    
                System.out.println("get redirect");
    
                //get redirect location
                String location;
                if ((location = cw.connection.getHeaderField("Location")) != null)
                {
                    if (location == url.trim())
                    {
                        Logger.getLogger().log("Redirect loop");
                    }
                    Logger.getLogger().log("Redirect: " + location);
                    result.redirectLocation = location.trim();
                }
    
                byte[] buffer = new byte[HTTP_BUFFER_SIZE];
                int count;
    
                System.out.println("compression");
    
                cw.inputStream = cw.connection.openInputStream();
                if (compressionEnabled)
                {
                    String encoding = cw.connection.getEncoding();
                    if ("gzip".equalsIgnoreCase(encoding))
                    {
                        cw.inputStream = new GZIPInputStream(cw.inputStream);
                    }
                }
    
                cw.inputStream = new DataInputStream(cw.inputStream);
    
                System.out.println("output stream");
    
                ByteArrayOutputStream out = new ByteArrayOutputStream();
                try
                {
                    while ((count = cw.inputStream.read(buffer)) >= 0)
                    {
                        out.write(buffer, 0, count);
                    }
                    result.bytes = out.toByteArray();
                }
                finally
                {
                    out.close();
                }
                cw.close();
                Logger.getLogger().log("Response complete");
            }
            catch (IOException e)
            {
                result.errorMessage = e.getMessage();
                result.completedWithError = true;
                Logger.getLogger().log("ERROR!:" + e.getMessage());
            }
            finally
            {
                removeConnectionWrapper(cw);
            }
            return result;
        }
    
        private static class ConnectionWrapper
        {
            final HttpRequest request;
            InputStream inputStream = null;
            OutputStream outputStream = null;
            HttpConnection connection = null;
    
            public ConnectionWrapper(HttpRequest request)
            {
                this.request = request;
            }
    
            public void close()
            {
                try
                {
                    if (outputStream != null)
                        outputStream.close();
                }
                catch (Exception e)
                {
                }
                try
                {
                    if (inputStream != null)
                        inputStream.close();
                }
                catch (Exception e)
                {
                }
                try
                {
                    if (connection != null)
                        connection.close();
                }
                catch (Exception e)
                {
                }
            }
        }
    }
    

    Sorry for the amount of code.

    I had our BES admin visit problematic page via a browser on the Server BES itself.

    Running, the Web server was an update of AJAX-style page that informs the user that they had no access to that particular content. Programmatically, see us all is "the page has been moved here" - but in a browser, it's a different story.

    Thanks again Peter for your insight!

  • Launch of QObject::connect() app causing crash

    Hello

    I am trying to learn a few tricks of Cascades SIGNAL and SLOT and want to write a custom slot that sets the value of a slider when you press an ImageView. However, when I include the code of the connect() function in my application, it compiles well but the app crashes during launch of "BlackBerry 10" screen

    Here is my code:

     // Create the slider
        Slider* opacitySlider = Slider::create().leftMargin(20.0f).rightMargin(20.0f);
        opacitySlider->setLayoutProperties(StackLayoutProperties::create().spaceQuota(1.0f));
        opacitySlider->setHorizontalAlignment(HorizontalAlignment::Fill);
    
        // Create the moon icon
        ImageView* moon = ImageView::create("asset:///images/moon.png");
        moon->setVerticalAlignment(VerticalAlignment::Center);
    

    My connection code is here. Note When I connect, Q_ASSERT, put in comment and Q_UNUSED lines, the code works fine:

        bool result2 = connect(moon, SIGNAL(onTouch(bb::cascades::TouchEvent *event)), this, SLOT(zeroOutSlider(bb::cascades::TouchEvent *event)));
        Q_ASSERT(result2);
        Q_UNUSED(result2);
    

    My location is defined as:

    void ApplicationUI::zeroOutSlider(bb::cascades::TouchEvent *event){
    
        if(event->isUp()){
            // Error: opacitySlider is not declared in this scope.
            //opacitySlider->setValue(0.0f);
        }
    
    }
    

    Note that I also comment little opacitySlider-> setValue() which is not recognized and raises a compile error.

    I tried using QML and it works fine, but I want to use custom for more elaborate things C++ functions (tried to use this Guide). Thought that I would start to base, but it does not work.

    Any help is appreciated

    Hello! It seems that the app is not crashing, but stops at Q_ASSERT because connect() fails and returns false. If the logs are configured correctly, you should see an error message as well.

    The signal is called 'touch', not of onTouch. 'on' prefix is added to the managers of signals QML. Thus, the correct signal statement is:

    SIGNAL (touch (bb::cascades:TouchEvent *))

    Parameter names must be omitted in SIGNAL() and SLOT().

    To resolve this problem:

    // Error: opacitySlider is not declared in this scope.
            //opacitySlider->setValue(0.0f);
    

    opacitySlider can be declared as a member variable (in the header file). It will be accessible to all functions of the class.

  • How to open a secure TLS on BlackBerry connection?

    Hi all

    I use a connection on BlackBerry. I have a certificate (.crt) client.

    How to open a secure connection?

    How to add the client certificate to server connection code?

    How to get the certificate of the server?

    How to check the certificate?

    I use this code, it throws an untrapped exception.

    SecureConnectionconn = connector (SecureConnection)
    .the ("tls://my server address:5061; deviceside = true", Connector.READ_WRITE, true);

    Please help me. As soon as possible send examples of code.

    Thank you

    Which exception gives you this code?

    I've attached an example that shows how to establish a secure connection.  It has defined for use WiFi only now (= wifi interface).

  • How do I know if a connection is made through a BES?

    Hello

    I'm new to the BlackBerry development; Sorry for what is likely to be a newbie question.

    Is there a way to determine if a network connection through BES or not?  Similarly, when you browse BES, is it possible to know the maximum file size that can be transmitted?

    Thanks in advance!

    Deviceside = false parameter can be used for a direct connection via a BlackBerry Enterprise Server.  The following link explains it further.

    What - in different ways to establish an HTTP connection or socket
    Article number: DB-00396

    http://www.BlackBerry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800451/800563/What_Is...

    There is no API to query the server, BlackBerry Enterprise Server to determine its value for the file size maximum.  However, if a file exceeds the maximum size it returns a 413 response on the connection code.  Please take a look at this link for more details.

    What is - HTTP 413 request entity too large
    Article number: DB-00623

    http://www.BlackBerry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800451/800563/What_Is...

  • Problem with HttpConnection when it connects only not to wifi - java.io.IOException: Tunnel failed

    Hi all

    I develop an application that communicates with a database MySQL via PHP stored on the server scripts. Until today I've developed using the Simulator, and everything has been fine. I now started to test on a device and, while being connected to wifi, everything is still fine. However, the minute I turn off wifi and let the network provider, O2 UK, I get:

    "Request failed: reason: java.io.IOException: Tunnel failed".

    The source of the connection code is as follows:

       public void run() {
           // The following code will only build under JDE 4.5 and later
    
           try {
               String connectionParameters = "";
               // JDE 4.3 is required to get WLANInfo
               if (WLANInfo.getWLANState() == WLANInfo.WLAN_STATE_CONNECTED) {
                   // Connected to a WiFi access point
                   connectionParameters = ";interface=wifi";
               } else {
                   int coverageStatus = CoverageInfo.getCoverageStatus();
                   ServiceRecord record = getWAP2ServiceRecord();
                   if (record != null
                           // In JDE 4.5 CoverageInfo changed the name of
    COVERAGE_CARRIER to COVERAGE_DIRECT
                           // The constant value for both is the same,
    '1', so you can use that to avoid any
                           // dependency on JDE 4.5
                           && (coverageStatus & CoverageInfo.COVERAGE_DIRECT) ==
                           CoverageInfo.COVERAGE_DIRECT) {
                       // Have network coverage and a WAP 2.0 service book record
                       connectionParameters = ";deviceside=true;ConnectionUID="
                               + record.getUid();
                   } else if ((coverageStatus & CoverageInfo.COVERAGE_MDS) ==
                           CoverageInfo.COVERAGE_MDS) {
                       // Have an MDS service book and network coverage
                       connectionParameters = ";deviceside=false";
                   } else if ((coverageStatus & CoverageInfo.COVERAGE_DIRECT) ==
                           CoverageInfo.COVERAGE_DIRECT) {
                       // Have network coverage but no WAP 2.0 service book record
                       connectionParameters = ";deviceside=true";
                   }
               }
    
               // Pop up a dialog showing the parameters chosen
               UiApplication.getUiApplication().invokeLater(
                       new DialogRunner("Connection Params: "
                               + connectionParameters));
    
               HttpConnection connection = (HttpConnection) Connector.open(url
                       + connectionParameters);
    
               connection.setRequestMethod(method);
               if (method.equals("POST") && postData != null) {
                   connection.setRequestProperty("Content-type",
                           "application/x-www-form-urlencoded");
                   OutputStream requestOutput = connection.openOutputStream();
                   requestOutput.write(postData);
                   requestOutput.close();
               }
               int responseCode = connection.getResponseCode();
               if (connection instanceof HttpsConnection) {
                   HttpsConnection secureConnection = (HttpsConnection) connection;
                   String issuer = secureConnection.getSecurityInfo()
                           .getServerCertificate().getIssuer();
                   UiApplication.getUiApplication().invokeLater(new
    DialogRunner("Secure Connection! Certificate issued by: " + issuer));
    
               }
               // Really you should check for more than just HTTP_OK
               if (responseCode != HttpConnection.HTTP_OK) {
                   screen.requestFailed("Unexpected response code: "
                           + responseCode);
                   connection.close();
                   return;
               }
    
               String contentType = connection.getHeaderField("Content-type");
               ByteArrayOutputStream baos = new ByteArrayOutputStream();
    
               InputStream responseData = connection.openInputStream();
               byte[] buffer = new byte[10000];
               int bytesRead = responseData.read(buffer);
               while (bytesRead > 0) {
                   baos.write(buffer, 0, bytesRead);
                   bytesRead = responseData.read(buffer);
               }
               baos.close();
               connection.close();
    
               screen.requestSucceeded(baos.toByteArray(), contentType);
           } catch (IOException ex) {
               screen.requestFailed(ex.toString());
           }
       }
    

    I scoured these forums and tried everything I can find. I tried different settings, including changing the APN settings both wap and mobile options for O2. Nothing seems to solve this problem.

    Any help would be appreciated!

    Thank you

    Jack

    OK, good news. Fixed. Thanks a lot for your answers. I would have understood the connection settings as they appear to have been the problem.

    I don't remember exactly which it generated, but I decided to try replacing it with the generator of connectionParameter above with the snippet connSuffix here:
    http://supportforums.BlackBerry.com/T5/Java-development/connecting-your-BlackBerry-http-and-socket-c...

    Worked like a dream, so I'm very indebted to all those who contributed to this. It now seems to work little matter the type of connection is available including BES.

    In case anyone is interested, however, I tried all combinations of settings APN bloody O2, but it came to nothing. I am disappointed that it was the connection settings I developed that a book by Apress, and I followed this particular part, Word for Word.

    Thank you all for the world of useful information here!

Maybe you are looking for

  • Satellite L500 - does not correctly play some CD

    Hello first time on this forum hoping to solve this problem. I often import CD into Itunes. We had the L500 for only less than a month and I noticed that he doesn't play the CD correctly. He plays all DVD very well, just to let you know.For example,

  • Satellite A110-153: RAM upgrade Question

    Hello I am the proud owner of a Toshiba Satellite A110-153 I've had for a few years.I am interested in the upgrade of RAM but stumbled upon this controversy. 1 internal memory expansion module sizes are 256, 512, 1024 MB.2. maximum speed of the inter

  • where to find windows vista 32 bit OEM Toshiba Portege laptop

    I need the OEM version of windows Vista 32 bit for Toshiba Portege M750 - 10G.

  • Calling agents do not return to the Hub

    Team, Good day to you! I just sent this tool to a customer via AD GPO MSI. We do this using the local such as specified in the user guide. Currently, it seems that the agent name is not back to the hub. I have a feeling that the ADM template that was

  • HP Pavilion p6-2003w Desktop PC CD/DVD driver problem

    First of all, Hello and thank you for taking time to see my problem. I don't remember exactly what I was doing, but I know that I wanted to perform a restore factory on my computer, and when I tried it only allows me to choose this option (in the Rec