Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add basic c-node and supporting services #2

Merged
merged 5 commits into from
Sep 19, 2024
Merged

Conversation

abelino
Copy link
Contributor

@abelino abelino commented Aug 30, 2024

  • Add basic c-node client for sending messages to other processes
  • Add log api

NOTE:

  • to test EPMD needs to be running. Run project w/ iex --sname app -S mix
  • BACNet.add_device(nil) is there to illustrate how a :gen.call works between an Elixir process and C-Node process. It returns {:error, :unimplemented} for now.

@abelino abelino requested a review from amclain August 30, 2024 01:34
@abelino abelino self-assigned this Aug 30, 2024
@abelino abelino force-pushed the setup-cnode-comms branch 2 times, most recently from 7d2b8c9 to ad175d4 Compare September 1, 2024 19:48
@amclain amclain added the feature label Sep 1, 2024
lib/bacnet.ex Outdated Show resolved Hide resolved
lib/bacnet.ex Outdated Show resolved Hide resolved
end

@doc false
defdelegate ei_log(level, term), to: Logger, as: :log
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⛔ (required)

The second arg is the log message as a string, right?

Suggested change
defdelegate ei_log(level, term), to: Logger, as: :log
defdelegate ei_log(level, message), to: Logger, as: :log

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It currently is returning a string, but nothing stopping us from this being able to return a term, i.e. structured data.

Copy link
Member

@amclain amclain Sep 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Oh, well that's cool.

lib/bacnet/application.ex Outdated Show resolved Hide resolved
lib/bacnet/application.ex Outdated Show resolved Hide resolved
src/ei_log.c Outdated Show resolved Hide resolved
src/ei_log.h Outdated Show resolved Hide resolved
src/main.c Outdated Show resolved Hide resolved
src/main.c Outdated Show resolved Hide resolved
src/main.c Outdated Show resolved Hide resolved
@abelino abelino force-pushed the setup-cnode-comms branch 4 times, most recently from 5dde4ca to 57f4e66 Compare September 2, 2024 19:56
@abelino abelino requested a review from amclain September 2, 2024 19:57
Copy link
Member

@amclain amclain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look closely at the naming. There are some I didn't mark because they'll show up in a find-and-replace. The rest is looking good.

src/ei_client.c Outdated Show resolved Hide resolved
src/ei_client.h Outdated Show resolved Hide resolved
src/ei_log.c Outdated Show resolved Hide resolved
src/main.c Outdated Show resolved Hide resolved
src/main.c Outdated Show resolved Hide resolved
src/main.c Outdated Show resolved Hide resolved
src/main.c Outdated Show resolved Hide resolved
@abelino abelino merged commit 2bf6d14 into main Sep 19, 2024
2 checks passed
@abelino abelino deleted the setup-cnode-comms branch September 19, 2024 06:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants