GithubHelp home page GithubHelp logo

Comments (3)

leisurehound avatar leisurehound commented on September 26, 2024

I'm getting a bad access error in Xcode debugger when attempting to publish for the first time at the if statement referencing curr->packet_id from __mqtt_next_pid called from mqtt_publish

/* check that the PID is unique */
        pid_exists = 0;
        for(curr = mqtt_mq_get(&(client->mq), 0); curr >= client->mq.queue_tail; --curr) {
            if (curr->packet_id == client->pid_lfsr) {
                pid_exists = 1;
                break;
            }
        }

from mqtt-c.

LiamBindle avatar LiamBindle commented on September 26, 2024

@leisurehound Thanks for writing.

Is combining the aspects of reconnect_subscriber.c and simple_publisher.c viable?

Absolutely. The examples are meant to be standalone demos of a certain feature/ability. The reconnect_subscriber demonstrates how the "reconnect" functionality is used (compare with simple_subscriber). For a real application you should implement your own handling and make use of the features you need (including potentially implementing your own PAL).

Also, can two sockets/struct clients be created to the same broker to publish multiple topics (at different update rates, effectively)?

Having mutliple mqtt_client is fine, and it's fine to connect them to the same broker. Note that you don't need multiple clients to publish at different rates. Doing mqtt_publish(...) stages the message for sending and it will be sent the next time mqtt_sync(...) is called. Assuming you're using a fixed sync rate (e.g., 500 ms) the rate of publishing is simply how often you do mqtt_publish().

BTW, I'm wrapping MQTT-C into a Swift wrapper so I can work in swift for the data logic bits.

Cool! Share the link when you're done, I'd be interested in checking it out.

I'm getting a bad access error in Xcode debugger when attempting to publish for the first time at the if statement referencing curr->packet_id from __mqtt_next_pid called from mqtt_publish

Sorry, I'm not familiar with the Xcode debugger. I'm afraid I don't have any insight.

from mqtt-c.

leisurehound avatar leisurehound commented on September 26, 2024

I'm getting a bad access error in Xcode debugger when attempting to publish for the first time at the if statement referencing curr->packet_id from __mqtt_next_pid called from mqtt_publish

Sorry, I'm not familiar with the Xcode debugger. I'm afraid I don't have any insight.

ok, seems LLVM is not liking the mutex being set before the call __mqtt_next_pid where it references curr->packet_id

from mqtt-c.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.