Access Control is now enabled for Gitlab Pages so you can now restrict Pages to authorized users only. If needed, make your website publicly available : Navigate to your project's Settings > General > Visibility and select Everyone in pages section.

Add the final project

parent 943095cc
pdflatex template.tex
makeindex -s "template.ist" -t "template.glg" -o "template.gls" "template.glo"
pdflatex template.tex
pdflatex template.tex
\ No newline at end of file
%----------------------------------------------------------------------------------------
% VARIOUS REQUIRED PACKAGES
%----------------------------------------------------------------------------------------
\usepackage{titlesec} % Allows customization of titles
\usepackage{graphicx} % Required for including pictures
\graphicspath{{Pictures/}} % Specifies the directory where pictures are stored
\usepackage{lipsum} % Inserts dummy text
\usepackage{tikz} % Required for drawing custom shapes
\usepackage{enumitem} % Customize lists
\setlist{nolistsep} % Reduce spacing between bullet points and numbered lists
\usepackage{booktabs} % Required for nicer horizontal rules in tables
\usepackage{eso-pic} % Required for specifying an image background in the title page
%----------------------------------------------------------------------------------------
% MAIN TABLE OF CONTENTS
%----------------------------------------------------------------------------------------
\usepackage{titletoc} % Required for manipulating the table of contents
\contentsmargin{0cm} % Removes the default margin
% Chapter text styling
\titlecontents{section}[1.25cm] % Indentation
{\addvspace{15pt}\large\sffamily\bfseries} % Spacing and font options for chapters
{\color{ocre!60}\contentslabel[\Large\thecontentslabel]{1.25cm}\color{ocre}} % Chapter number
{}
{\color{ocre!60}\normalsize\sffamily\bfseries\;\titlerule*[.5pc]{.}\;\thecontentspage} % Page number
% Section text styling
\titlecontents{subsection}[1.25cm] % Indentation
{\addvspace{5pt}\sffamily\bfseries} % Spacing and font options for sections
{\contentslabel[\thecontentslabel]{1.25cm}} % Section number
{}
{\sffamily\hfill\color{black}\thecontentspage} % Page number
[]
% Subsection text styling
\titlecontents{subsubsection}[1.25cm] % Indentation
{\addvspace{1pt}\sffamily\small} % Spacing and font options for subsections
{\contentslabel[\thecontentslabel]{1.25cm}} % Subsection number
{}
{\sffamily\;\titlerule*[.5pc]{.}\;\thecontentspage} % Page number
[]
%----------------------------------------------------------------------------------------
% PAGE HEADERS
%----------------------------------------------------------------------------------------
\usepackage{fancyhdr} % Required for header and footer configuration
\pagestyle{fancy}
\renewcommand{\sectionmark}[1]{\markright{\sffamily\normalsize\thesection\hspace{5pt}#1}{}} % Section text font settings
\fancyhf{} \fancyhead[R]{\sffamily\normalsize\thepage} % Font setting for the page number in the header
\fancyhead[L]{Davide Anthony Previte}
\fancyfoot[L]{\includegraphics[scale=.4]{Pictures/heia_logo.png}} % Print the nearest section name on the left side of odd pages
\renewcommand{\headrulewidth}{0.5pt} % Width of the rule under the header
\addtolength{\headheight}{2.5pt} % Increase the spacing around the header slightly
\renewcommand{\footrulewidth}{0pt} % Removes the rule in the footer
\fancypagestyle{plain}{} % Style for when a plain pagestyle is specified
% For an unclear reason, the package should be loaded now and not later
\usepackage{hyperref}
\hypersetup{hidelinks,backref=true,pagebackref=true,hyperindex=true,colorlinks=false,breaklinks=true,urlcolor= ocre,bookmarks=true,bookmarksopen=false,pdftitle={Title},pdfauthor={Author}}
\setlength\parindent{0pt} %Supprime les alinéa
\setlength{\parskip}{8pt} %Augmente l'espace entre paragraphe
This diff is collapsed.
CC = gcc
#CFLAGS = -Wall -Wextra
CFLAGS += -g
LDFLAGS = -lpthread
CFILES = open62541intel/open62541.c server_rfid.c rfid.c
OBJ = server_rfid.o rfid.o
TARGET = rfid
ARM = arm-linux-gnueabihf-gcc
RASPITARGET = rfid_raspi
RASPIFILES = open62541.c server_rfid.c rfid.c
#%.o: %.c
all : $(RASPITARGET)
$(RASPITARGET) : $(OBJ)
$(CC) $(CFLAGS) -o $(RASPITARGET) $(RASPIFILES) $(LDFLAGS)
clean :
rm -f $(OBJ) $(RASPITARGET) *~
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/**
* Copyright 2018 University of Applied Sciences Western Switzerland / Fribourg
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Project: HEIA-FR / Project 5
*
* Abstract: Badge RFID connected to the iIoT
*
* Purpose: Read the UID from the TWN4 reader
*
* Author: Davide Previte / HEIA-FR
* Date: 15.01.2019
*
*/
#include "rfid.h"
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
char uidS[MAX_UID]; //char array that should contains the UID
/**
* open the reader with termios structure
* @param serial is the location of the reader ("/dev/ttyACM0" by default)
* @return fd is the file desciptor of the RFID reader
*/
int openSerial(const char *serial)
{
int fd = open(serial, O_RDWR | O_NOCTTY | O_NDELAY);
if (fd == -1)
printf("Error! in Opening RFID Reader \n");
else
printf("RFID Reader Opened Successfully \n");
/**---------- Setting the Attributes of the serial port using termios structure --------- */
struct termios SerialPortSettings; /* Create the structure */
tcgetattr(fd, &SerialPortSettings); /* Get the current attributes of the Serial port */
cfsetispeed(&SerialPortSettings, B115200); /* Set Read Speed as 9600 */
cfsetospeed(&SerialPortSettings, B115200); /* Set Write Speed as 9600 */
SerialPortSettings.c_cflag &= ~PARENB; /* Disables the Parity Enable bit(PARENB),So No Parity */
SerialPortSettings.c_cflag &= ~CSTOPB; /* CSTOPB = 2 Stop bits,here it is cleared so 1 Stop bit */
SerialPortSettings.c_cflag &= ~CSIZE; /* Clears the mask for setting the data size */
SerialPortSettings.c_cflag |= CS8; /* Set the data bits = 8 */
SerialPortSettings.c_cflag &= ~CRTSCTS; /* No Hardware flow Control */
SerialPortSettings.c_cflag |= CREAD | CLOCAL; /* Enable receiver,Ignore Modem Control lines */
SerialPortSettings.c_iflag &= ~(IXON | IXOFF | IXANY); /* Disable XON/XOFF flow control both i/p and o/p */
SerialPortSettings.c_iflag &= ~(ICANON | ECHO | ECHOE | ISIG); /* Non Cannonical mode */
SerialPortSettings.c_oflag &= ~OPOST; /*No Output Processing*/
if ((tcsetattr(fd, TCSANOW, &SerialPortSettings)) != 0) /* Set the attributes to the termios structure*/
printf("ERROR ! in Setting attributes \n");
else
printf("BaudRate = 115200 \n StopBits = 1 \n Parity = none\n");
return fd;
}
/**
* read the uid and return it
* @param fd is the file descriptor of the RFID reader
* @return uidS char[] with the UID read by the RFID reader
*/
char* readUID(int fd)
{
unsigned nbBytes = 0; //number of bytes read
char x; //char that is read by the reader
read(fd, &x, 1);
//if the char read is one of this, nothing to do
while(x == '\0' || x == '\n' || x == '\r') read(fd, &x, 1);
//read the UID while there is a char
while(x != '\n' && x != '\r'){
uidS[nbBytes++] = x;
if (nbBytes >= sizeof(uidS)) {
printf("there is an error");
return 0; // --> error!!!
}
read(fd, &x, 1);
}
//the last char should be a 0 because it is a string
uidS[nbBytes] = 0;
return uidS;
}
#pragma once
#ifndef RFID_H
#define RFID_H
/**
* Copyright 2018 University of Applied Sciences Western Switzerland / Fribourg
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Project: HEIA-FR / Project 5
*
* Abstract: Badge RFID connected to the iIoT
*
* Purpose: Header for reading the UID from the TWN4 reader
*
* Author: Davide Previte / HEIA-FR
* Date: 15.01.2019
*/
#include <errno.h>
#include <fcntl.h>
#include <string.h>
#include <termios.h>
#include <unistd.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
//Warning : must be big enough !!
#define MAX_UID 50
/**
* open the reader with termios structure
* @param serial is the location of the reader ("/dev/ttyACM0" by default)