Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
Beam Positoning Monitor - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Beam Positoning Monitor - Software
Commits
65cd8020
Commit
65cd8020
authored
Jun 11, 2015
by
Lucas Russo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
src/libs/libbpmclient/*: refactoring to adhere to CLASS RFC
RFC located in
http://rfc.zeromq.org/spec:21
parent
0ec3b03c
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
184 additions
and
43 deletions
+184
-43
Makefile
src/libs/libbpmclient/Makefile
+22
-13
bpm_client.h
src/libs/libbpmclient/include/bpm_client.h
+13
-0
bpm_client_classes.h
src/libs/libbpmclient/include/bpm_client_classes.h
+62
-0
bpm_client_codes.h
src/libs/libbpmclient/include/bpm_client_codes.h
+0
-0
bpm_client_core.h
src/libs/libbpmclient/include/bpm_client_core.h
+8
-10
bpm_client_err.h
src/libs/libbpmclient/include/bpm_client_err.h
+8
-2
bpm_client_prelude.h
src/libs/libbpmclient/include/bpm_client_prelude.h
+16
-0
bpm_client_revision.h
src/libs/libbpmclient/include/bpm_client_revision.h
+24
-0
bpm_client_rw_param.h
src/libs/libbpmclient/include/bpm_client_rw_param.h
+6
-6
bpm_client_rw_param_codes.h
src/libs/libbpmclient/include/bpm_client_rw_param_codes.h
+8
-0
bpm_client_core.c
src/libs/libbpmclient/src/bpm_client_core.c
+2
-8
bpm_client_err.c
src/libs/libbpmclient/src/bpm_client_err.c
+1
-1
bpm_client_revision.c
src/libs/libbpmclient/src/bpm_client_revision.c
+11
-0
bpm_client_rw_param.c
src/libs/libbpmclient/src/bpm_client_rw_param.c
+3
-3
No files found.
src/libs/libbpmclient/Makefile
View file @
65cd8020
...
...
@@ -72,6 +72,9 @@ LIBS = -lzmq -lczmq -lmlm -luuid
# General library flags -L<libdir>
LFLAGS
=
# Source directory
SRC_DIR
=
src
# Specific board objects
OBJS_BOARD
=
../../sm_io/modules/acq/ddr3_map.o
# Specific platform objects
...
...
@@ -90,9 +93,10 @@ OBJS_EXTERNAL = ../../sm_io/modules/sm_io_codes.o \
boards_INCLUDE_DIRS
=
-I
../../../include/boards/
$(BOARD)
# Include directories
INCLUDE_DIRS
=
-I
.
-I
../../../
include
-I
../liberrhand
-I
../libhutils
-I
../libdisptable
\
INCLUDE_DIRS
=
-I
.
-Iinclude
-I
../liberrhand
-I
../libhutils
-I
../libdisptable
\
-I
../libconvc
\
$(boards_INCLUDE_DIRS)
\
-I
../../../include
\
-I
../../sm_io/modules
\
-I
../../sm_io/modules/fmc130m_4ch
\
-I
../../sm_io/modules/acq
\
...
...
@@ -113,7 +117,8 @@ OUT = $(LIBBPMCLIENT)
.SECONDEXPANSION
:
# Library objects
$(LIBBPMCLIENT)
_OBJS_LIB
=
bpm_client.o bpm_client_err.o bpm_client_rw_param.o
$(LIBBPMCLIENT)
_OBJS_LIB
=
$(SRC_DIR)
/bpm_client_core.o
$(SRC_DIR)
/bpm_client_err.o
\
$(SRC_DIR)
/bpm_client_rw_param.o
# Objects common for both server and client libraries.
common_OBJS
=
$(OBJS_BOARD)
$(OBJS_PLATFORM)
$(OBJS_EXTERNAL)
...
...
@@ -133,8 +138,7 @@ $(LIBBPMCLIENT)_CODE_HEADERS = ../../sm_io/modules/fmc130m_4ch/sm_io_fmc130m_4ch
../libhutils/hutils.h
\
../libhutils/hutils_err.h
\
../libhutils/hutils_math.h
\
../libhutils/hutils_utils.h
\
bpm_client_codes.h
../libhutils/hutils_utils.h
$(LIBBPMCLIENT)
_FUNC_EXPORTS
=
../../sm_io/modules/fmc130m_4ch/sm_io_fmc130m_4ch_exports.h
\
../../sm_io/modules/acq/sm_io_acq_exports.h
\
...
...
@@ -149,7 +153,11 @@ $(LIBBPMCLIENT)_ACQ_HEADERS = \
../../../include/boards/
$(BOARD)
/priv_defs/
$
(
$(LIBBPMCLIENT)
_ACQ_HEADER_BASENAME
)
_
$(BOARD)
.h
$(LIBBPMCLIENT)
_INST_ACQ_HEADERS
=
$
(
$(LIBBPMCLIENT)
_ACQ_HEADER_BASENAME
)
.h
$(LIBBPMCLIENT)_HEADERS = $($(LIBBPMCLIENT)_OBJS_LIB
:
.o=.h) $($(LIBBPMCLIENT)_CODE_HEADERS)
\
$(LIBBPMCLIENT)
_HEADERS_LIB
=
include/bpm_client.h include/bpm_client_classes.h
\
include/bpm_client_prelude.h include/bpm_client_codes.h
\
$
(
subst src/,include/,
$
(
patsubst %.o,%.h,
$
(
$(LIBBPMCLIENT)
_OBJS_LIB
)))
$(LIBBPMCLIENT)
_HEADERS
=
$
(
$(LIBBPMCLIENT)
_HEADERS_LIB
)
$
(
$(LIBBPMCLIENT)
_CODE_HEADERS
)
\
$
(
$(LIBBPMCLIENT)
_FUNC_EXPORTS
)
# Installation headers
...
...
@@ -160,11 +168,11 @@ GIT_REVISION = $(shell git describe --dirty --always)
GIT_USER_NAME
=
$(
shell
git config
--get
user.name
)
GIT_USER_EMAIL
=
$(
shell
git config
--get
user.email
)
REVISION_NAME
=
bpm_client_revision
OBJ_REVISION
=
$
(
addsuffix .o,
$(REVISION_NAME
)
)
revision_OBJS
=
$(SRC_DIR)
/bpm_client_revision.o
revision_SRCS
=
$
(
patsubst %.o,%.c,
$(revision_OBJS
)
)
OBJS_all
=
$(common_OBJS)
$
(
$(LIBBPMCLIENT)
_OBJS
)
\
$(
OBJ_REVISION
)
$(
revision_OBJS
)
# Libraries suffixes
LIB_STATIC_SUFFIX
=
.a
...
...
@@ -184,18 +192,19 @@ TARGET_SHARED_VER = $(addsuffix $(LIB_SHARED_SUFFIX).$(LIB_VER), $(OUT))
all
:
$(TARGET_STATIC) $(TARGET_SHARED_VER) pre_inst
# Compile static library
%.a
:
$$($$*_OBJS) $(
OBJ_REVISION
)
%.a
:
$$($$*_OBJS) $(
revision_OBJS
)
$(AR)
rcs
$@
$^
# Compile dynamic library
%.so.$(LIB_VER)
:
$$($$*_OBJS) $(
OBJ_REVISION
)
%.so.$(LIB_VER)
:
$$($$*_OBJS) $(
revision_OBJS
)
$(CC)
-shared
-fPIC
-Wl
,-soname,
$@
-o
$@
$^
$(LDFLAGS)
$(LIBS)
$(REVISION_NAME).o
:
$(REVISION_NAME).c
$(CC)
$(CFLAGS)
-DGIT_REVISION
=
"
\"
$(GIT_REVISION)
\"
"
\
# Special rule for the revision object
$(revision_OBJS)
:
$(revision_SRCS)
$(CC)
$(CFLAGS)
$(INCLUDE_DIRS)
-DGIT_REVISION
=
"
\"
$(GIT_REVISION)
\"
"
\
-DGIT_USER_NAME
=
"
\"
$(GIT_USER_NAME)
\"
"
\
-DGIT_USER_EMAIL
=
"
\"
$(GIT_USER_EMAIL)
\"
"
\
-c
$<
-c
$<
-o
$@
# Pull in dependency info for *existing* .o files and don't complain if the
# corresponding .d file is not found
...
...
src/libs/libbpmclient/include/bpm_client.h
0 → 100644
View file @
65cd8020
/*
* Copyright (C) 2014 LNLS (www.lnls.br)
* Author: Lucas Russo <lucas.russo@lnls.br>
*
* Released according to the GNU LGPL, version 3 or any later version.
*/
#ifndef _BPM_CLIENT_H_
#define _BPM_CLIENT_H_
#include "bpm_client_classes.h"
#endif
src/libs/libbpmclient/include/bpm_client_classes.h
0 → 100644
View file @
65cd8020
/*
* Copyright (C) 2014 LNLS (www.lnls.br)
* Author: Lucas Russo <lucas.russo@lnls.br>
*
* Released according to the GNU LGPL, version 3 or any later version.
*/
#ifndef _BPM_CLIENT_CLASSES_H_
#define _BPM_CLIENT_CLASSES_H_
/* Set up environment for the application */
#include "bpm_client_prelude.h"
/* External dependencies */
#include <czmq.h>
#include <malamute.h>
/* Internal libraries dependencies */
#include "acq_chan.h"
/* General dependencies */
#include "bpm_client_codes.h"
/* BPM version macros for compile-time API detection */
#define BPM_CLIENT_VERSION_MAJOR 0
#define BPM_CLIENT_VERSION_MINOR 0
#define BPM_CLIENT_VERSION_PATCH 1
#define BPM_CLIENT_MAKE_VERSION(major, minor, patch) \
((major) * 10000 + (minor) * 100 + (patch))
#define BPM_CLIENT_VERSION \
BPM_CLIENT_MAKE_VERSION(BPM_CLIENT_VERSION_MAJOR, BPM_CLIENT_VERSION_MINOR, \
BPM_CLIENT_VERSION_PATCH)
#if defined (__WINDOWS__)
# if defined LIBBPM_CLIENT_STATIC
# define BPM_CLIENT_EXPORT
# elif defined LIBBPM_CLIENT_EXPORTS
# define BPM_CLIENT_EXPORT __declspec(dllexport)
# else
# define BPM_CLIENT_EXPORT __declspec(dllimport)
# endif
#else
# define BPM_CLIENT_EXPORT
#endif
/* Opaque class structures to allow forward references */
/* Public API classes */
/* Forward bpm_client_err_e declaration enumeration */
typedef
enum
_bpm_client_err_e
bpm_client_err_e
;
/* Opaque bpm_client_t structure */
typedef
struct
_bpm_client_t
bpm_client_t
;
/* BPM CLIENT */
#include "bpm_client_err.h"
#include "bpm_client_rw_param.h"
#include "bpm_client_core.h"
#endif
src/libs/libbpmclient/bpm_client_codes.h
→
src/libs/libbpmclient/
include/
bpm_client_codes.h
View file @
65cd8020
File moved
src/libs/libbpmclient/
bpm_client
.h
→
src/libs/libbpmclient/
include/bpm_client_core
.h
View file @
65cd8020
...
...
@@ -5,17 +5,12 @@
* Released according to the GNU LGPL, version 3 or any later version.
*/
#ifndef _BPM_CLIENT_H_
#define _BPM_CLIENT_H_
#ifndef _BPM_CLIENT_
CORE_
H_
#define _BPM_CLIENT_
CORE_
H_
#include <inttypes.h>
#include <malamute.h>
#include "bpm_client_codes.h"
#include "bpm_client_err.h"
#include "acq_chan.h"
/* SMIO acq channel definition */
typedef
struct
_bpm_client_t
bpm_client_t
;
#ifdef __cplusplus
extern
"C"
{
#endif
/********************************************************/
/************************ Our API ***********************/
...
...
@@ -757,5 +752,8 @@ bpm_client_err_e bpm_get_afc_diag_build_user_email (bpm_client_t *self, char *se
bpm_client_err_e
func_polling
(
bpm_client_t
*
self
,
char
*
name
,
char
*
service
,
uint32_t
*
input
,
uint32_t
*
output
,
int
timeout
);
#ifdef __cplusplus
}
#endif
#endif
src/libs/libbpmclient/bpm_client_err.h
→
src/libs/libbpmclient/
include/
bpm_client_err.h
View file @
65cd8020
...
...
@@ -11,6 +11,10 @@
#ifndef _BPM_CLIENT_ERR_H_
#define _BPM_CLIENT_ERR_H_
#ifdef __cplusplus
extern
"C"
{
#endif
enum
_bpm_client_err_e
{
BPM_CLIENT_SUCCESS
=
0
,
/* No error */
...
...
@@ -25,9 +29,11 @@ enum _bpm_client_err_e
BPM_CLIENT_ERR_END
/* End of enum marker */
};
typedef
enum
_bpm_client_err_e
bpm_client_err_e
;
/* Convert enumeration type to string */
const
char
*
bpm_client_err_str
(
bpm_client_err_e
err
);
#ifdef __cplusplus
}
#endif
#endif
src/libs/libbpmclient/include/bpm_client_prelude.h
0 → 100644
View file @
65cd8020
/*
* Copyright (C) 2015 LNLS (www.lnls.br)
* Author: Lucas Russo <lucas.russo@lnls.br>
*
* Released according to the GNU LGPL, version 3 or any later version.
*/
#ifndef _BPM_CLIENT_PRELUDE_H_
#define _BPM_CLIENT_PRELUDE_H_
/* External dependencies */
#include <inttypes.h>
#include <sys/types.h>
#include <stdbool.h>
#endif
src/libs/libbpmclient/include/bpm_client_revision.h
0 → 100644
View file @
65cd8020
/*
* Copyright (C) 2014 LNLS (www.lnls.br)
* Author: Lucas Russo <lucas.russo@lnls.br>
*
* Released according to the GNU LGPL, version 3 or any later version.
*/
#ifndef _BPM_CLIENT_REVISION_H_
#define _BPM_CLIENT_REVISION_H_
#ifdef __cplusplus
extern
"C"
{
#endif
extern
const
char
*
build_revision
;
extern
const
char
*
build_date
;
extern
const
char
*
build_user_name
;
extern
const
char
*
build_user_email
;
#ifdef __cplusplus
}
#endif
#endif
src/libs/libbpmclient/bpm_client_rw_param.h
→
src/libs/libbpmclient/
include/
bpm_client_rw_param.h
View file @
65cd8020
...
...
@@ -8,12 +8,9 @@
#ifndef _BPM_CLIENT_RW_PARAM_H_
#define _BPM_CLIENT_RW_PARAM_H_
#include <inttypes.h>
#include <malamute.h>
#include "bpm_client_codes.h"
#include "bpm_client_rw_param_codes.h"
#include "bpm_client_err.h"
#ifdef __cplusplus
extern
"C"
{
#endif
#define READ_MODE 1
#define WRITE_MODE 0
...
...
@@ -87,5 +84,8 @@ bpm_client_err_e param_client_read_gen (bpm_client_t *self, char *service,
bpm_client_err_e
param_client_read_double
(
bpm_client_t
*
self
,
char
*
service
,
uint32_t
operation
,
double
*
param_out
);
#ifdef __cplusplus
}
#endif
#endif
src/libs/libbpmclient/bpm_client_rw_param_codes.h
→
src/libs/libbpmclient/
include/
bpm_client_rw_param_codes.h
View file @
65cd8020
...
...
@@ -8,6 +8,10 @@
#ifndef _BPM_CLIENT_RW_PARAM_CODES_
#define _BPM_CLIENT_RW_PARAM_CODES_
#ifdef __cplusplus
extern
"C"
{
#endif
/* Messaging Reply OPCODES */
#define RW_REPLY_SIZE (sizeof(uint32_t))
#define RW_REPLY_TYPE uint32_t
...
...
@@ -23,4 +27,8 @@
#define PARAM_OK 0
#define PARAM_ERR 1
#ifdef __cplusplus
}
#endif
#endif
src/libs/libbpmclient/
bpm_client
.c
→
src/libs/libbpmclient/
src/bpm_client_core
.c
View file @
65cd8020
...
...
@@ -6,14 +6,10 @@
*/
#include "bpm_client.h"
/* Private headers */
#include "errhand.h"
#include "sm_io_acq_codes.h"
#include "sm_io_dsp_codes.h"
#include "sm_io_swap_codes.h"
#include "sm_io_swap_useful_macros.h"
#include "bpm_client_rw_param_codes.h"
#include "
bpm_client_rw_param
.h"
#include "
sm_io_swap_useful_macros
.h"
/* Undef ASSERT_ALLOC to avoid conflicting with other ASSERT_ALLOC */
#ifdef ASSERT_TEST
...
...
@@ -1961,8 +1957,6 @@ bpm_client_err_e bpm_get_afc_diag_build_user_email (bpm_client_t *self, char *se
rw
,
revision_data
,
sizeof
(
*
revision_data
));
}
/**************** Helper Function ****************/
static
bpm_client_err_e
_func_polling
(
bpm_client_t
*
self
,
char
*
name
,
char
*
service
,
uint32_t
*
input
,
uint32_t
*
output
,
int
timeout
);
...
...
src/libs/libbpmclient/bpm_client_err.c
→
src/libs/libbpmclient/
src/
bpm_client_err.c
View file @
65cd8020
...
...
@@ -8,7 +8,7 @@
/* Error definitions and output stringification based on the work available
* at the libsllp project repository: https://github.com/brunoseivam/libsllp */
#include "bpm_client
_err
.h"
#include "bpm_client.h"
static
const
char
*
bpm_client_err
[
BPM_CLIENT_ERR_END
]
=
{
...
...
src/libs/libbpmclient/bpm_client_revision.c
→
src/libs/libbpmclient/
src/
bpm_client_revision.c
View file @
65cd8020
/*
* Copyright (C) 2015 LNLS (www.lnls.br)
* Author: Lucas Russo <lucas.russo@lnls.br>
*
* Released according to the GNU LGPL, version 3 or any later version.
*/
#include "bpm_client.h"
const
char
*
build_revision
=
GIT_REVISION
;
const
char
*
build_date
=
__DATE__
" "
__TIME__
;
src/libs/libbpmclient/bpm_client_rw_param.c
→
src/libs/libbpmclient/
src/
bpm_client_rw_param.c
View file @
65cd8020
...
...
@@ -5,11 +5,11 @@
* Released according to the GNU LGPL, version 3 or any later version.
*/
#include "errhand.h"
#include "bpm_client.h"
#include "bpm_client_rw_param.h"
/* Private headers */
#include "errhand.h"
#include "bpm_client_rw_param_codes.h"
#include "bpm_client_revision.h"
/* Undef ASSERT_ALLOC to avoid conflicting with other ASSERT_ALLOC */
#ifdef ASSERT_TEST
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment