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

Use erlang term based port instead of a c-node #3

Merged
merged 3 commits into from
Oct 11, 2024
Merged

Use erlang term based port instead of a c-node #3

merged 3 commits into from
Oct 11, 2024

Conversation

abelino
Copy link
Contributor

@abelino abelino commented Oct 5, 2024

Move to using port since the bacnet-stack library wants to support a single device type per instance.

@abelino abelino requested a review from amclain October 5, 2024 07:53
@abelino abelino self-assigned this Oct 5, 2024
@abelino abelino changed the title Add erlang term based port Use erlang term based port instead of a c-node Oct 5, 2024
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.

Just look out for the one ⛔

lib/bacnet.ex Outdated Show resolved Hide resolved
lib/bacnet.ex Outdated Show resolved Hide resolved
lib/bacnet.ex Outdated Show resolved Hide resolved
src/log.c Outdated Show resolved Hide resolved
Comment on lines +39 to +40
int port_start(handle_request_t handle_request_cb)
{
Copy link
Member

Choose a reason for hiding this comment

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

Starting a new line with { is a good question for the style guide.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We talked through style-guide in a call and concluded the current style in this PR produces code that is easier to digest/read. This also aligns to similar styles found in the linux and zephyr codebases. i.e.

int sum(int a, int b)
{
  return a + b;
}

There are other variations of this style that aren't present in this PR but are also important to illustrate:

request_t*
parse_request_data(request_context_t *context, void *buffer, size_t length)
{
  return NULL;
}
request_t* parse_request_data(
  request_context_t *context,
  request_type_t type,
  void *buffer,
  size_t length
) {
  return NULL;
}

or

request_t*
parse_request_data(
  request_context_t *context,
  request_type_t type,
  void *buffer,
  size_t length
) {
  return NULL;
}

@abelino abelino merged commit 62be087 into main Oct 11, 2024
2 checks passed
@abelino abelino deleted the use-port branch October 11, 2024 01:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants