RASCSI/src/raspberrypi/scsimon.cpp
Uwe Seimet b5f71fb3b8
Support for folder filter and nested image files (#551)
* Extracted code

* Initial support for (optional) recursive image file listings

* Manpage update

* Added support for image file filter

* Updated filtering

* Made image scan depth configurable

* Code cleanup, initial support for creating nested file

* Check for existing folder

* Cleanup

* Cleanup

* Copy/rename/create

* Updated delete operation

* Delete empty folders

* Code cleanup

* Fixed typo

* Check image file nesting level

* Updated error handling

* Fixed warning

* Renaming

* Error message update

* Interface comment updates

* Added depth to image info

* Fixed scan depth check

* Squashed commit of the following:

commit 94786aec54
Author: Uwe Seimet <48174652+uweseimet@users.noreply.github.com>
Date:   Tue Dec 21 08:43:21 2021 +0100

    Added support for operation meta data, code cleanup (#534)

    * Added messages

    * Comment update

    * Interface update

    * Support for localized descriptions

    * Sort operations

    * Completed meta data

    * rasctl -s returns operation meta data

    * Manpage update

    * Type update

    * Comment update

    * Description updates

    * Comment update

    * Added convenience method

    * Added convenience method

    * Code cleanup

    * Comment update

    * Display permitted values

    * For completeness sake added permitted boolean values

    * Added support for default value

    * Removed redundant message field

    * Description update

    * Description upddate

    * Squashed commit of the following:

    commit 8171c6ea27982c736c30c0db69a7fdde07ee10ce
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Sat Dec 18 12:43:14 2021 +0100

        The data type is implicit

    commit fb01dc9d82e8ff7456b05a0cb9d08069adacc64c
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Sat Dec 18 12:37:49 2021 +0100

        Renaming

    commit 057dbf1aca7be3f7e76a5ff89a582a276b6d3089
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Sat Dec 18 12:29:54 2021 +0100

        Comment update

    commit 5f699aad2f835f72accdb445d1e59f094aeb108f
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Sat Dec 18 12:24:25 2021 +0100

        Signature update

    commit cbcf8b09f9d1ba7b82f816269bcfe91d9f00eb6e
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Sat Dec 18 12:22:45 2021 +0100

        Signature update

    commit a8148ef802ca809e5a305d2caa69856c9033d932
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Sat Dec 18 12:16:46 2021 +0100

        Comment update

    commit ce685a92d4827e131d80d10ecd56e2b3baf173f8
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Sat Dec 18 12:15:46 2021 +0100

        Use map instead of list

    commit 454c0438f3589904f5dbe5253963dd200ea416dd
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Sat Dec 18 10:47:36 2021 +0100

        Updated size check

    commit b386dbba4b0262f4f6f02aecb2a1daeffd41f4a2
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Sat Dec 18 01:23:43 2021 +0100

        Initial improvements

    * Default value update

    * Comment update

    * Comment update

    * Map operations by ordinal

    * Added safeguard against unknown operations

    * Added cast

    * Data type update

    * Sort map by operation name

    * Renaming

    * Code cleanup

    * Comment update

    * Renaming

    * Comment update

    * Description updates

    * Fixed typo

    * Added operation

    * Logging update

    * Interface comment update

    * Fixed typo

    * Aded operation parameters

    * Updated handling of mandatory parameters

    * Updated assertion handling

    * Added missing condition

    * Removed duplicate cod3

    * Code cleanup

    * Logging update

    * Removed duplicate code

    * Code cleanup

    * Squashed commit of the following:

    commit 4ae273ccbd
    Author: akuker <34318535+akuker@users.noreply.github.com>
    Date:   Sun Dec 19 22:30:22 2021 -0600

        Loopback tester pcb (#545)

    commit 46c5c1966f
    Author: akuker <34318535+akuker@users.noreply.github.com>
    Date:   Sun Dec 19 22:29:59 2021 -0600

        RaSCSI Zero version 1.0 (#546)

    commit d09df31d67
    Author: Daniel Markstedt <markstedt@gmail.com>
    Date:   Sun Dec 19 20:25:23 2021 -0800

        Remove redundant code from OLED script (#547)

    commit d8828da690
    Author: akuker <34318535+akuker@users.noreply.github.com>
    Date:   Sun Dec 19 21:02:50 2021 -0600

        Added list of sponsors

    commit bcd7e8396d
    Author: Daniel Markstedt <markstedt@gmail.com>
    Date:   Sun Dec 19 15:51:45 2021 -0800

        Second attempt at properly creating the manpage dir (#542)

    commit c887edfc8c
    Author: Daniel Markstedt <markstedt@gmail.com>
    Date:   Sun Dec 19 15:50:03 2021 -0800

        Remove special elevated privileges for the Web Interface (#536)

        * Use the pi_shutdown method to restart the rascsi service

        * Use the pi_shutdown method to restart the rascsi service

        * Remove modifications to sudoers no longer needed

        * Introduce sleeps attempting to connect to socket; reduce overall number of retries

        * Remove systemd helped methods and the functionality that depends on it

        * Attempts to speed up splash code

        * Remove unneccessary verbosity

        * Attempt to optimize service definition

    commit 801aebfb96
    Author: Daniel Markstedt <markstedt@gmail.com>
    Date:   Sun Dec 19 15:47:22 2021 -0800

        More readable message when downloading a file (#531)

    commit 29cf58288f
    Author: Daniel Markstedt <markstedt@gmail.com>
    Date:   Sun Dec 19 15:47:03 2021 -0800

        Add a warning notice when ejecting removable media (#526)

    commit 7efa895239
    Author: Daniel Markstedt <markstedt@gmail.com>
    Date:   Sun Dec 19 15:46:22 2021 -0800

        Unzip zipfiles before storing to iso (#525)

        * Unzip zipfiles before storing to iso

        * Add helptext

        * Skip unzip for MacZip format

        * Should not be an fstring

    commit 39bc485671
    Author: Daniel Markstedt <markstedt@gmail.com>
    Date:   Sun Dec 19 15:28:22 2021 -0800

        Add pip3 to global dependencies; remove duplicates from monitor_rascs… (#523)

        * Add pip3 to global dependencies; remove duplicates from monitor_rascsi dependencies

        * Cleanup

    * Shutdown functionality is only available if started with root permissions

    * Only restrict shutdown parameters, not everything if not root

    * Updated operation count check

commit 693ade2967
Author: Daniel Markstedt <markstedt@gmail.com>
Date:   Mon Dec 20 12:04:23 2021 -0800

    Bump Macproxy version to 21.12.2 (#550)

commit 958fb95908
Author: akuker <34318535+akuker@users.noreply.github.com>
Date:   Mon Dec 20 12:50:14 2021 -0600

    Adjust bus settle delay to match SCSI standard (#544)

    * Move the GCC v10 compiler flags into makefile instead of easyinstall.sh

    * #504 - Update the bus settle time to match the SCSI standard

    Co-authored-by: RaSCSI User <user@rascsi.com>

commit 200bc7251f
Author: Daniel Markstedt <markstedt@gmail.com>
Date:   Mon Dec 20 06:20:22 2021 -0800

    More helpful error message when IP does not resolve for OLED screen (#541)

    * More helpful error message

    * Remove confusing fallback IP

    * Tweak message

commit 4ae273ccbd
Author: akuker <34318535+akuker@users.noreply.github.com>
Date:   Sun Dec 19 22:30:22 2021 -0600

    Loopback tester pcb (#545)

commit 46c5c1966f
Author: akuker <34318535+akuker@users.noreply.github.com>
Date:   Sun Dec 19 22:29:59 2021 -0600

    RaSCSI Zero version 1.0 (#546)

commit d09df31d67
Author: Daniel Markstedt <markstedt@gmail.com>
Date:   Sun Dec 19 20:25:23 2021 -0800

    Remove redundant code from OLED script (#547)

commit d8828da690
Author: akuker <34318535+akuker@users.noreply.github.com>
Date:   Sun Dec 19 21:02:50 2021 -0600

    Added list of sponsors

commit bcd7e8396d
Author: Daniel Markstedt <markstedt@gmail.com>
Date:   Sun Dec 19 15:51:45 2021 -0800

    Second attempt at properly creating the manpage dir (#542)

commit c887edfc8c
Author: Daniel Markstedt <markstedt@gmail.com>
Date:   Sun Dec 19 15:50:03 2021 -0800

    Remove special elevated privileges for the Web Interface (#536)

    * Use the pi_shutdown method to restart the rascsi service

    * Use the pi_shutdown method to restart the rascsi service

    * Remove modifications to sudoers no longer needed

    * Introduce sleeps attempting to connect to socket; reduce overall number of retries

    * Remove systemd helped methods and the functionality that depends on it

    * Attempts to speed up splash code

    * Remove unneccessary verbosity

    * Attempt to optimize service definition

commit 801aebfb96
Author: Daniel Markstedt <markstedt@gmail.com>
Date:   Sun Dec 19 15:47:22 2021 -0800

    More readable message when downloading a file (#531)

commit 29cf58288f
Author: Daniel Markstedt <markstedt@gmail.com>
Date:   Sun Dec 19 15:47:03 2021 -0800

    Add a warning notice when ejecting removable media (#526)

commit 7efa895239
Author: Daniel Markstedt <markstedt@gmail.com>
Date:   Sun Dec 19 15:46:22 2021 -0800

    Unzip zipfiles before storing to iso (#525)

    * Unzip zipfiles before storing to iso

    * Add helptext

    * Skip unzip for MacZip format

    * Should not be an fstring

commit 39bc485671
Author: Daniel Markstedt <markstedt@gmail.com>
Date:   Sun Dec 19 15:28:22 2021 -0800

    Add pip3 to global dependencies; remove duplicates from monitor_rascs… (#523)

    * Add pip3 to global dependencies; remove duplicates from monitor_rascsi dependencies

    * Cleanup

commit ec31198d83
Author: Uwe Seimet <48174652+uweseimet@users.noreply.github.com>
Date:   Sun Dec 19 11:54:10 2021 +0100

    Optional authentication by access token (#529)

    * Added authentication by access token

    * No authentication is required for getting the rascsi version

    * Added comment

    * Interface description update

    * Manpage update

    * Added error code

    * Enum value update (backwards compatible)

    * Error code update

    * Error code update

    * Added CHECK_AUTHENTICATION

    * Comment update

    * VERSION_INFO also requires authentication

    * rasctl: Made token an optional parameter for -P

    * Fixed interface comment

commit e32211ef73
Author: Uwe Seimet <48174652+uweseimet@users.noreply.github.com>
Date:   Sun Dec 19 11:49:17 2021 +0100

    Recursive image file scan and image file filter (#532)

    * Extracted code

    * Initial support for (optional) recursive image file listings

    * Manpage update

    * Added support for image file filter

    * Updated filtering

    * Made image scan depth configurable

* Squashed commit of the following:

commit 192b14169f
Author: Uwe Seimet <Uwe.Seimet@seimet.de>
Date:   Tue Dec 21 09:19:05 2021 +0100

    Meta data update

commit b319d72601
Author: Uwe Seimet <Uwe.Seimet@seimet.de>
Date:   Tue Dec 21 09:02:39 2021 +0100

    Squashed commit of the following:

    commit 0ab4918c5a59f978f48cf26f431ff809e9ddae33
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Mon Dec 20 16:52:03 2021 +0100

        Scan depth determines availability of folder filter

    commit 16590cc4e4420a348fae610d749082c9d718be0a
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Mon Dec 20 15:47:08 2021 +0100

        Updated operation count check

    commit 82f7c99755f535a7a5c30fe66e377705c5306faa
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Mon Dec 20 15:41:32 2021 +0100

        Only restrict shutdown parameters, not everything if not root

    commit 9bd50d37b11c48b2130e4f6e66d12def88ddc38f
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Mon Dec 20 15:28:08 2021 +0100

        Shutdown functionality is only available if started with root permissions

    commit aa5f3331abf4c178e8ce738c14fd584bd41d1b94
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Mon Dec 20 10:26:14 2021 +0100

        Squashed commit of the following:

        commit 4ae273ccbd
        Author: akuker <34318535+akuker@users.noreply.github.com>
        Date:   Sun Dec 19 22:30:22 2021 -0600

            Loopback tester pcb (#545)

        commit 46c5c1966f
        Author: akuker <34318535+akuker@users.noreply.github.com>
        Date:   Sun Dec 19 22:29:59 2021 -0600

            RaSCSI Zero version 1.0 (#546)

        commit d09df31d67
        Author: Daniel Markstedt <markstedt@gmail.com>
        Date:   Sun Dec 19 20:25:23 2021 -0800

            Remove redundant code from OLED script (#547)

        commit d8828da690
        Author: akuker <34318535+akuker@users.noreply.github.com>
        Date:   Sun Dec 19 21:02:50 2021 -0600

            Added list of sponsors

        commit bcd7e8396d
        Author: Daniel Markstedt <markstedt@gmail.com>
        Date:   Sun Dec 19 15:51:45 2021 -0800

            Second attempt at properly creating the manpage dir (#542)

        commit c887edfc8c
        Author: Daniel Markstedt <markstedt@gmail.com>
        Date:   Sun Dec 19 15:50:03 2021 -0800

            Remove special elevated privileges for the Web Interface (#536)

            * Use the pi_shutdown method to restart the rascsi service

            * Use the pi_shutdown method to restart the rascsi service

            * Remove modifications to sudoers no longer needed

            * Introduce sleeps attempting to connect to socket; reduce overall number of retries

            * Remove systemd helped methods and the functionality that depends on it

            * Attempts to speed up splash code

            * Remove unneccessary verbosity

            * Attempt to optimize service definition

        commit 801aebfb96
        Author: Daniel Markstedt <markstedt@gmail.com>
        Date:   Sun Dec 19 15:47:22 2021 -0800

            More readable message when downloading a file (#531)

        commit 29cf58288f
        Author: Daniel Markstedt <markstedt@gmail.com>
        Date:   Sun Dec 19 15:47:03 2021 -0800

            Add a warning notice when ejecting removable media (#526)

        commit 7efa895239
        Author: Daniel Markstedt <markstedt@gmail.com>
        Date:   Sun Dec 19 15:46:22 2021 -0800

            Unzip zipfiles before storing to iso (#525)

            * Unzip zipfiles before storing to iso

            * Add helptext

            * Skip unzip for MacZip format

            * Should not be an fstring

        commit 39bc485671
        Author: Daniel Markstedt <markstedt@gmail.com>
        Date:   Sun Dec 19 15:28:22 2021 -0800

            Add pip3 to global dependencies; remove duplicates from monitor_rascs… (#523)

            * Add pip3 to global dependencies; remove duplicates from monitor_rascsi dependencies

            * Cleanup

    commit a1f4b28f92bd9f7cdba18c04f61d3721fc7c720f
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Sun Dec 19 21:50:15 2021 +0100

        Comment update

    commit 9cbc06caf5f00ce85e0f7f984c871ed614e2e483
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Sun Dec 19 21:49:09 2021 +0100

        Option update

    commit c4aa39c2285c5c72e2ea28ad749f5670dd10e89f
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Sun Dec 19 21:46:37 2021 +0100

        Merged feature_folder_filter

    commit ea386fc74c
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Sun Dec 19 19:05:07 2021 +0100

        Code cleanup

    commit 17c3201135
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Sun Dec 19 19:03:13 2021 +0100

        Removed duplicate code

    commit 296f816dd3
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Sun Dec 19 18:40:49 2021 +0100

        Logging update

    commit 73e0df8557
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Sun Dec 19 17:28:02 2021 +0100

        Code cleanup

    commit 405dbb034c
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Sun Dec 19 17:13:40 2021 +0100

        Removed duplicate cod3

    commit c7c168a942
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Sun Dec 19 17:08:02 2021 +0100

        Added missing condition

    commit 6af5394f78
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Sun Dec 19 16:16:12 2021 +0100

        Updated assertion handling

    commit 632fe1acd8
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Sun Dec 19 14:33:01 2021 +0100

        Updated handling of mandatory parameters

    commit a4e0d506c6
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Sun Dec 19 14:14:09 2021 +0100

        Aded operation parameters

    commit fc783e6a43
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Sun Dec 19 12:38:35 2021 +0100

        Fixed typo

    commit cb1b498459
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Sun Dec 19 12:37:13 2021 +0100

        Interface comment update

    commit e2d4347ce6
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Sun Dec 19 12:35:50 2021 +0100

        Logging update

    commit cecb72df3e
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Sun Dec 19 12:13:44 2021 +0100

        Added operation

    commit bbf153ccd6
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Sun Dec 19 12:09:49 2021 +0100

        Fixed typo

    commit 29fa5c2f96
    Merge: 28a36fa ec31198
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Sun Dec 19 12:07:34 2021 +0100

        Merge branch 'develop' into feature_meta_data

    commit 28a36fa308
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Sat Dec 18 15:51:02 2021 +0100

        Description updates

    commit 73df9f136c
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Sat Dec 18 14:37:58 2021 +0100

        Comment update

    commit c3ea3c8b37
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Sat Dec 18 14:34:48 2021 +0100

        Renaming

    commit 6a84edd0fb
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Sat Dec 18 14:22:31 2021 +0100

        Comment update

    commit c0d6e66afe
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Sat Dec 18 14:20:20 2021 +0100

        Code cleanup

    commit cc81b588eb
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Sat Dec 18 14:18:31 2021 +0100

        Renaming

    commit c88628e12a
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Sat Dec 18 14:17:50 2021 +0100

        Sort map by operation name

    commit b64001e8a4
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Sat Dec 18 13:39:44 2021 +0100

        Data type update

    commit 8177cd3062
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Sat Dec 18 13:37:23 2021 +0100

        Added cast

    commit b8599ba088
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Sat Dec 18 13:35:40 2021 +0100

        Added safeguard against unknown operations

    commit 6b14ba6511
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Sat Dec 18 13:26:21 2021 +0100

        Map operations by ordinal

    commit ee101f2c6b
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Sat Dec 18 13:14:31 2021 +0100

        Comment update

    commit 67c958ed37
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Sat Dec 18 13:13:06 2021 +0100

        Comment update

    commit d1a9c40745
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Sat Dec 18 13:04:58 2021 +0100

        Default value update

    commit d9dbbc0bb3
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Sat Dec 18 12:47:36 2021 +0100

        Squashed commit of the following:

        commit 8171c6ea27982c736c30c0db69a7fdde07ee10ce
        Author: Uwe Seimet <Uwe.Seimet@seimet.de>
        Date:   Sat Dec 18 12:43:14 2021 +0100

            The data type is implicit

        commit fb01dc9d82e8ff7456b05a0cb9d08069adacc64c
        Author: Uwe Seimet <Uwe.Seimet@seimet.de>
        Date:   Sat Dec 18 12:37:49 2021 +0100

            Renaming

        commit 057dbf1aca7be3f7e76a5ff89a582a276b6d3089
        Author: Uwe Seimet <Uwe.Seimet@seimet.de>
        Date:   Sat Dec 18 12:29:54 2021 +0100

            Comment update

        commit 5f699aad2f835f72accdb445d1e59f094aeb108f
        Author: Uwe Seimet <Uwe.Seimet@seimet.de>
        Date:   Sat Dec 18 12:24:25 2021 +0100

            Signature update

        commit cbcf8b09f9d1ba7b82f816269bcfe91d9f00eb6e
        Author: Uwe Seimet <Uwe.Seimet@seimet.de>
        Date:   Sat Dec 18 12:22:45 2021 +0100

            Signature update

        commit a8148ef802ca809e5a305d2caa69856c9033d932
        Author: Uwe Seimet <Uwe.Seimet@seimet.de>
        Date:   Sat Dec 18 12:16:46 2021 +0100

            Comment update

        commit ce685a92d4827e131d80d10ecd56e2b3baf173f8
        Author: Uwe Seimet <Uwe.Seimet@seimet.de>
        Date:   Sat Dec 18 12:15:46 2021 +0100

            Use map instead of list

        commit 454c0438f3589904f5dbe5253963dd200ea416dd
        Author: Uwe Seimet <Uwe.Seimet@seimet.de>
        Date:   Sat Dec 18 10:47:36 2021 +0100

            Updated size check

        commit b386dbba4b0262f4f6f02aecb2a1daeffd41f4a2
        Author: Uwe Seimet <Uwe.Seimet@seimet.de>
        Date:   Sat Dec 18 01:23:43 2021 +0100

            Initial improvements

    commit 5d6862b6b0
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Fri Dec 17 23:22:27 2021 +0100

        Description upddate

    commit 69263b3e4b
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Fri Dec 17 23:21:38 2021 +0100

        Description update

    commit 49e14f7078
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Fri Dec 17 23:19:08 2021 +0100

        Removed redundant message field

    commit ff468aafa8
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Fri Dec 17 23:09:18 2021 +0100

        Added support for default value

    commit 2da717a0a0
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Fri Dec 17 22:57:59 2021 +0100

        For completeness sake added permitted boolean values

    commit 5d894d2e4f
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Fri Dec 17 22:53:07 2021 +0100

        Display permitted values

    commit acc7d3cba5
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Fri Dec 17 20:37:03 2021 +0100

        Comment update

    commit f846242aea
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Fri Dec 17 20:35:07 2021 +0100

        Code cleanup

    commit 5a9592f102
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Fri Dec 17 20:24:33 2021 +0100

        Added convenience method

    commit 9d258d9979
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Fri Dec 17 20:05:53 2021 +0100

        Added convenience method

    commit 6c4103989b
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Fri Dec 17 19:45:20 2021 +0100

        Comment update

    commit 7d543451f0
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Fri Dec 17 19:27:50 2021 +0100

        Description updates

    commit f4b0e50e66
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Fri Dec 17 19:23:29 2021 +0100

        Comment update

    commit 35dd3f6282
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Fri Dec 17 19:21:12 2021 +0100

        Type update

    commit 7a94c0e6e0
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Fri Dec 17 19:17:05 2021 +0100

        Manpage update

    commit 4179110bac
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Fri Dec 17 19:13:42 2021 +0100

        rasctl -s returns operation meta data

    commit eed83bb005
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Fri Dec 17 19:05:29 2021 +0100

        Completed meta data

    commit 4a7528d9d3
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Fri Dec 17 18:39:18 2021 +0100

        Sort operations

    commit d3af9a142c
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Fri Dec 17 18:29:22 2021 +0100

        Support for localized descriptions

    commit b4ff4f52ab
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Fri Dec 17 17:53:11 2021 +0100

        Interface update

    commit e8d9e97fe5
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Fri Dec 17 16:59:49 2021 +0100

        Comment update

    commit 22753b1547
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Fri Dec 17 16:57:39 2021 +0100

        Added messages

commit b3a9292458
Merge: ea3bb83 94786ae
Author: Uwe Seimet <Uwe.Seimet@seimet.de>
Date:   Tue Dec 21 08:57:56 2021 +0100

    Merge branch 'develop' into feature_folder_filter

commit ea3bb8363a
Author: Uwe Seimet <Uwe.Seimet@seimet.de>
Date:   Tue Dec 21 08:53:30 2021 +0100

    Squashed commit of the following:

    commit 94786aec54
    Author: Uwe Seimet <48174652+uweseimet@users.noreply.github.com>
    Date:   Tue Dec 21 08:43:21 2021 +0100

        Added support for operation meta data, code cleanup (#534)

        * Added messages

        * Comment update

        * Interface update

        * Support for localized descriptions

        * Sort operations

        * Completed meta data

        * rasctl -s returns operation meta data

        * Manpage update

        * Type update

        * Comment update

        * Description updates

        * Comment update

        * Added convenience method

        * Added convenience method

        * Code cleanup

        * Comment update

        * Display permitted values

        * For completeness sake added permitted boolean values

        * Added support for default value

        * Removed redundant message field

        * Description update

        * Description upddate

        * Squashed commit of the following:

        commit 8171c6ea27982c736c30c0db69a7fdde07ee10ce
        Author: Uwe Seimet <Uwe.Seimet@seimet.de>
        Date:   Sat Dec 18 12:43:14 2021 +0100

            The data type is implicit

        commit fb01dc9d82e8ff7456b05a0cb9d08069adacc64c
        Author: Uwe Seimet <Uwe.Seimet@seimet.de>
        Date:   Sat Dec 18 12:37:49 2021 +0100

            Renaming

        commit 057dbf1aca7be3f7e76a5ff89a582a276b6d3089
        Author: Uwe Seimet <Uwe.Seimet@seimet.de>
        Date:   Sat Dec 18 12:29:54 2021 +0100

            Comment update

        commit 5f699aad2f835f72accdb445d1e59f094aeb108f
        Author: Uwe Seimet <Uwe.Seimet@seimet.de>
        Date:   Sat Dec 18 12:24:25 2021 +0100

            Signature update

        commit cbcf8b09f9d1ba7b82f816269bcfe91d9f00eb6e
        Author: Uwe Seimet <Uwe.Seimet@seimet.de>
        Date:   Sat Dec 18 12:22:45 2021 +0100

            Signature update

        commit a8148ef802ca809e5a305d2caa69856c9033d932
        Author: Uwe Seimet <Uwe.Seimet@seimet.de>
        Date:   Sat Dec 18 12:16:46 2021 +0100

            Comment update

        commit ce685a92d4827e131d80d10ecd56e2b3baf173f8
        Author: Uwe Seimet <Uwe.Seimet@seimet.de>
        Date:   Sat Dec 18 12:15:46 2021 +0100

            Use map instead of list

        commit 454c0438f3589904f5dbe5253963dd200ea416dd
        Author: Uwe Seimet <Uwe.Seimet@seimet.de>
        Date:   Sat Dec 18 10:47:36 2021 +0100

            Updated size check

        commit b386dbba4b0262f4f6f02aecb2a1daeffd41f4a2
        Author: Uwe Seimet <Uwe.Seimet@seimet.de>
        Date:   Sat Dec 18 01:23:43 2021 +0100

            Initial improvements

        * Default value update

        * Comment update

        * Comment update

        * Map operations by ordinal

        * Added safeguard against unknown operations

        * Added cast

        * Data type update

        * Sort map by operation name

        * Renaming

        * Code cleanup

        * Comment update

        * Renaming

        * Comment update

        * Description updates

        * Fixed typo

        * Added operation

        * Logging update

        * Interface comment update

        * Fixed typo

        * Aded operation parameters

        * Updated handling of mandatory parameters

        * Updated assertion handling

        * Added missing condition

        * Removed duplicate cod3

        * Code cleanup

        * Logging update

        * Removed duplicate code

        * Code cleanup

        * Squashed commit of the following:

        commit 4ae273ccbd
        Author: akuker <34318535+akuker@users.noreply.github.com>
        Date:   Sun Dec 19 22:30:22 2021 -0600

            Loopback tester pcb (#545)

        commit 46c5c1966f
        Author: akuker <34318535+akuker@users.noreply.github.com>
        Date:   Sun Dec 19 22:29:59 2021 -0600

            RaSCSI Zero version 1.0 (#546)

        commit d09df31d67
        Author: Daniel Markstedt <markstedt@gmail.com>
        Date:   Sun Dec 19 20:25:23 2021 -0800

            Remove redundant code from OLED script (#547)

        commit d8828da690
        Author: akuker <34318535+akuker@users.noreply.github.com>
        Date:   Sun Dec 19 21:02:50 2021 -0600

            Added list of sponsors

        commit bcd7e8396d
        Author: Daniel Markstedt <markstedt@gmail.com>
        Date:   Sun Dec 19 15:51:45 2021 -0800

            Second attempt at properly creating the manpage dir (#542)

        commit c887edfc8c
        Author: Daniel Markstedt <markstedt@gmail.com>
        Date:   Sun Dec 19 15:50:03 2021 -0800

            Remove special elevated privileges for the Web Interface (#536)

            * Use the pi_shutdown method to restart the rascsi service

            * Use the pi_shutdown method to restart the rascsi service

            * Remove modifications to sudoers no longer needed

            * Introduce sleeps attempting to connect to socket; reduce overall number of retries

            * Remove systemd helped methods and the functionality that depends on it

            * Attempts to speed up splash code

            * Remove unneccessary verbosity

            * Attempt to optimize service definition

        commit 801aebfb96
        Author: Daniel Markstedt <markstedt@gmail.com>
        Date:   Sun Dec 19 15:47:22 2021 -0800

            More readable message when downloading a file (#531)

        commit 29cf58288f
        Author: Daniel Markstedt <markstedt@gmail.com>
        Date:   Sun Dec 19 15:47:03 2021 -0800

            Add a warning notice when ejecting removable media (#526)

        commit 7efa895239
        Author: Daniel Markstedt <markstedt@gmail.com>
        Date:   Sun Dec 19 15:46:22 2021 -0800

            Unzip zipfiles before storing to iso (#525)

            * Unzip zipfiles before storing to iso

            * Add helptext

            * Skip unzip for MacZip format

            * Should not be an fstring

        commit 39bc485671
        Author: Daniel Markstedt <markstedt@gmail.com>
        Date:   Sun Dec 19 15:28:22 2021 -0800

            Add pip3 to global dependencies; remove duplicates from monitor_rascs… (#523)

            * Add pip3 to global dependencies; remove duplicates from monitor_rascsi dependencies

            * Cleanup

        * Shutdown functionality is only available if started with root permissions

        * Only restrict shutdown parameters, not everything if not root

        * Updated operation count check

    commit 693ade2967
    Author: Daniel Markstedt <markstedt@gmail.com>
    Date:   Mon Dec 20 12:04:23 2021 -0800

        Bump Macproxy version to 21.12.2 (#550)

    commit 958fb95908
    Author: akuker <34318535+akuker@users.noreply.github.com>
    Date:   Mon Dec 20 12:50:14 2021 -0600

        Adjust bus settle delay to match SCSI standard (#544)

        * Move the GCC v10 compiler flags into makefile instead of easyinstall.sh

        * #504 - Update the bus settle time to match the SCSI standard

        Co-authored-by: RaSCSI User <user@rascsi.com>

    commit 200bc7251f
    Author: Daniel Markstedt <markstedt@gmail.com>
    Date:   Mon Dec 20 06:20:22 2021 -0800

        More helpful error message when IP does not resolve for OLED screen (#541)

        * More helpful error message

        * Remove confusing fallback IP

        * Tweak message

    commit 4ae273ccbd
    Author: akuker <34318535+akuker@users.noreply.github.com>
    Date:   Sun Dec 19 22:30:22 2021 -0600

        Loopback tester pcb (#545)

    commit 46c5c1966f
    Author: akuker <34318535+akuker@users.noreply.github.com>
    Date:   Sun Dec 19 22:29:59 2021 -0600

        RaSCSI Zero version 1.0 (#546)

    commit d09df31d67
    Author: Daniel Markstedt <markstedt@gmail.com>
    Date:   Sun Dec 19 20:25:23 2021 -0800

        Remove redundant code from OLED script (#547)

    commit d8828da690
    Author: akuker <34318535+akuker@users.noreply.github.com>
    Date:   Sun Dec 19 21:02:50 2021 -0600

        Added list of sponsors

    commit bcd7e8396d
    Author: Daniel Markstedt <markstedt@gmail.com>
    Date:   Sun Dec 19 15:51:45 2021 -0800

        Second attempt at properly creating the manpage dir (#542)

    commit c887edfc8c
    Author: Daniel Markstedt <markstedt@gmail.com>
    Date:   Sun Dec 19 15:50:03 2021 -0800

        Remove special elevated privileges for the Web Interface (#536)

        * Use the pi_shutdown method to restart the rascsi service

        * Use the pi_shutdown method to restart the rascsi service

        * Remove modifications to sudoers no longer needed

        * Introduce sleeps attempting to connect to socket; reduce overall number of retries

        * Remove systemd helped methods and the functionality that depends on it

        * Attempts to speed up splash code

        * Remove unneccessary verbosity

        * Attempt to optimize service definition

    commit 801aebfb96
    Author: Daniel Markstedt <markstedt@gmail.com>
    Date:   Sun Dec 19 15:47:22 2021 -0800

        More readable message when downloading a file (#531)

    commit 29cf58288f
    Author: Daniel Markstedt <markstedt@gmail.com>
    Date:   Sun Dec 19 15:47:03 2021 -0800

        Add a warning notice when ejecting removable media (#526)

    commit 7efa895239
    Author: Daniel Markstedt <markstedt@gmail.com>
    Date:   Sun Dec 19 15:46:22 2021 -0800

        Unzip zipfiles before storing to iso (#525)

        * Unzip zipfiles before storing to iso

        * Add helptext

        * Skip unzip for MacZip format

        * Should not be an fstring

    commit 39bc485671
    Author: Daniel Markstedt <markstedt@gmail.com>
    Date:   Sun Dec 19 15:28:22 2021 -0800

        Add pip3 to global dependencies; remove duplicates from monitor_rascs… (#523)

        * Add pip3 to global dependencies; remove duplicates from monitor_rascsi dependencies

        * Cleanup

commit 94786aec54
Author: Uwe Seimet <48174652+uweseimet@users.noreply.github.com>
Date:   Tue Dec 21 08:43:21 2021 +0100

    Added support for operation meta data, code cleanup (#534)

    * Added messages

    * Comment update

    * Interface update

    * Support for localized descriptions

    * Sort operations

    * Completed meta data

    * rasctl -s returns operation meta data

    * Manpage update

    * Type update

    * Comment update

    * Description updates

    * Comment update

    * Added convenience method

    * Added convenience method

    * Code cleanup

    * Comment update

    * Display permitted values

    * For completeness sake added permitted boolean values

    * Added support for default value

    * Removed redundant message field

    * Description update

    * Description upddate

    * Squashed commit of the following:

    commit 8171c6ea27982c736c30c0db69a7fdde07ee10ce
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Sat Dec 18 12:43:14 2021 +0100

        The data type is implicit

    commit fb01dc9d82e8ff7456b05a0cb9d08069adacc64c
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Sat Dec 18 12:37:49 2021 +0100

        Renaming

    commit 057dbf1aca7be3f7e76a5ff89a582a276b6d3089
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Sat Dec 18 12:29:54 2021 +0100

        Comment update

    commit 5f699aad2f835f72accdb445d1e59f094aeb108f
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Sat Dec 18 12:24:25 2021 +0100

        Signature update

    commit cbcf8b09f9d1ba7b82f816269bcfe91d9f00eb6e
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Sat Dec 18 12:22:45 2021 +0100

        Signature update

    commit a8148ef802ca809e5a305d2caa69856c9033d932
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Sat Dec 18 12:16:46 2021 +0100

        Comment update

    commit ce685a92d4827e131d80d10ecd56e2b3baf173f8
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Sat Dec 18 12:15:46 2021 +0100

        Use map instead of list

    commit 454c0438f3589904f5dbe5253963dd200ea416dd
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Sat Dec 18 10:47:36 2021 +0100

        Updated size check

    commit b386dbba4b0262f4f6f02aecb2a1daeffd41f4a2
    Author: Uwe Seimet <Uwe.Seimet@seimet.de>
    Date:   Sat Dec 18 01:23:43 2021 +0100

        Initial improvements

    * Default value update

    * Comment update

    * Comment update

    * Map operations by ordinal

    * Added safeguard against unknown operations

    * Added cast

    * Data type update

    * Sort map by operation name

    * Renaming

    * Code cleanup

    * Comment update

    * Renaming

    * Comment update

    * Description updates

    * Fixed typo

    * Added operation

    * Logging update

    * Interface comment update

    * Fixed typo

    * Aded operation parameters

    * Updated handling of mandatory parameters

    * Updated assertion handling

    * Added missing condition

    * Removed duplicate cod3

    * Code cleanup

    * Logging update

    * Removed duplicate code

    * Code cleanup

    * Squashed commit of the following:

    commit 4ae273ccbd
    Author: akuker <34318535+akuker@users.noreply.github.com>
    Date:   Sun Dec 19 22:30:22 2021 -0600

        Loopback tester pcb (#545)

    commit 46c5c1966f
    Author: akuker <34318535+akuker@users.noreply.github.com>
    Date:   Sun Dec 19 22:29:59 2021 -0600

        RaSCSI Zero version 1.0 (#546)

    commit d09df31d67
    Author: Daniel Markstedt <markstedt@gmail.com>
    Date:   Sun Dec 19 20:25:23 2021 -0800

        Remove redundant code from OLED script (#547)

    commit d8828da690
    Author: akuker <34318535+akuker@users.noreply.github.com>
    Date:   Sun Dec 19 21:02:50 2021 -0600

        Added list of sponsors

    commit bcd7e8396d
    Author: Daniel Markstedt <markstedt@gmail.com>
    Date:   Sun Dec 19 15:51:45 2021 -0800

        Second attempt at properly creating the manpage dir (#542)

    commit c887edfc8c
    Author: Daniel Markstedt <markstedt@gmail.com>
    Date:   Sun Dec 19 15:50:03 2021 -0800

        Remove special elevated privileges for the Web Interface (#536)

        * Use the pi_shutdown method to restart the rascsi service

        * Use the pi_shutdown method to restart the rascsi service

        * Remove modifications to sudoers no longer needed

        * Introduce sleeps attempting to connect to socket; reduce overall number of retries

        * Remove systemd helped methods and the functionality that depends on it

        * Attempts to speed up splash code

        * Remove unneccessary verbosity

        * Attempt to optimize service definition

    commit 801aebfb96
    Author: Daniel Markstedt <markstedt@gmail.com>
    Date:   Sun Dec 19 15:47:22 2021 -0800

        More readable message when downloading a file (#531)

    commit 29cf58288f
    Author: Daniel Markstedt <markstedt@gmail.com>
    Date:   Sun Dec 19 15:47:03 2021 -0800

        Add a warning notice when ejecting removable media (#526)

    commit 7efa895239
    Author: Daniel Markstedt <markstedt@gmail.com>
    Date:   Sun Dec 19 15:46:22 2021 -0800

        Unzip zipfiles before storing to iso (#525)

        * Unzip zipfiles before storing to iso

        * Add helptext

        * Skip unzip for MacZip format

        * Should not be an fstring

    commit 39bc485671
    Author: Daniel Markstedt <markstedt@gmail.com>
    Date:   Sun Dec 19 15:28:22 2021 -0800

        Add pip3 to global dependencies; remove duplicates from monitor_rascs… (#523)

        * Add pip3 to global dependencies; remove duplicates from monitor_rascsi dependencies

        * Cleanup

    * Shutdown functionality is only available if started with root permissions

    * Only restrict shutdown parameters, not everything if not root

    * Updated operation count check

commit 693ade2967
Author: Daniel Markstedt <markstedt@gmail.com>
Date:   Mon Dec 20 12:04:23 2021 -0800

    Bump Macproxy version to 21.12.2 (#550)

commit 958fb95908
Author: akuker <34318535+akuker@users.noreply.github.com>
Date:   Mon Dec 20 12:50:14 2021 -0600

    Adjust bus settle delay to match SCSI standard (#544)

    * Move the GCC v10 compiler flags into makefile instead of easyinstall.sh

    * #504 - Update the bus settle time to match the SCSI standard

    Co-authored-by: RaSCSI User <user@rascsi.com>

commit 200bc7251f
Author: Daniel Markstedt <markstedt@gmail.com>
Date:   Mon Dec 20 06:20:22 2021 -0800

    More helpful error message when IP does not resolve for OLED screen (#541)

    * More helpful error message

    * Remove confusing fallback IP

    * Tweak message

commit f59eeb842e
Author: Uwe Seimet <Uwe.Seimet@seimet.de>
Date:   Mon Dec 20 10:25:28 2021 +0100

    Squashed commit of the following:

    commit 4ae273ccbd
    Author: akuker <34318535+akuker@users.noreply.github.com>
    Date:   Sun Dec 19 22:30:22 2021 -0600

        Loopback tester pcb (#545)

    commit 46c5c1966f
    Author: akuker <34318535+akuker@users.noreply.github.com>
    Date:   Sun Dec 19 22:29:59 2021 -0600

        RaSCSI Zero version 1.0 (#546)

    commit d09df31d67
    Author: Daniel Markstedt <markstedt@gmail.com>
    Date:   Sun Dec 19 20:25:23 2021 -0800

        Remove redundant code from OLED script (#547)

    commit d8828da690
    Author: akuker <34318535+akuker@users.noreply.github.com>
    Date:   Sun Dec 19 21:02:50 2021 -0600

        Added list of sponsors

    commit bcd7e8396d
    Author: Daniel Markstedt <markstedt@gmail.com>
    Date:   Sun Dec 19 15:51:45 2021 -0800

        Second attempt at properly creating the manpage dir (#542)

    commit c887edfc8c
    Author: Daniel Markstedt <markstedt@gmail.com>
    Date:   Sun Dec 19 15:50:03 2021 -0800

        Remove special elevated privileges for the Web Interface (#536)

        * Use the pi_shutdown method to restart the rascsi service

        * Use the pi_shutdown method to restart the rascsi service

        * Remove modifications to sudoers no longer needed

        * Introduce sleeps attempting to connect to socket; reduce overall number of retries

        * Remove systemd helped methods and the functionality that depends on it

        * Attempts to speed up splash code

        * Remove unneccessary verbosity

        * Attempt to optimize service definition

    commit 801aebfb96
    Author: Daniel Markstedt <markstedt@gmail.com>
    Date:   Sun Dec 19 15:47:22 2021 -0800

        More readable message when downloading a file (#531)

    commit 29cf58288f
    Author: Daniel Markstedt <markstedt@gmail.com>
    Date:   Sun Dec 19 15:47:03 2021 -0800

        Add a warning notice when ejecting removable media (#526)

    commit 7efa895239
    Author: Daniel Markstedt <markstedt@gmail.com>
    Date:   Sun Dec 19 15:46:22 2021 -0800

        Unzip zipfiles before storing to iso (#525)

        * Unzip zipfiles before storing to iso

        * Add helptext

        * Skip unzip for MacZip format

        * Should not be an fstring

    commit 39bc485671
    Author: Daniel Markstedt <markstedt@gmail.com>
    Date:   Sun Dec 19 15:28:22 2021 -0800

        Add pip3 to global dependencies; remove duplicates from monitor_rascs… (#523)

        * Add pip3 to global dependencies; remove duplicates from monitor_rascsi dependencies

        * Cleanup

commit 4ae273ccbd
Author: akuker <34318535+akuker@users.noreply.github.com>
Date:   Sun Dec 19 22:30:22 2021 -0600

    Loopback tester pcb (#545)

commit 46c5c1966f
Author: akuker <34318535+akuker@users.noreply.github.com>
Date:   Sun Dec 19 22:29:59 2021 -0600

    RaSCSI Zero version 1.0 (#546)

commit d09df31d67
Author: Daniel Markstedt <markstedt@gmail.com>
Date:   Sun Dec 19 20:25:23 2021 -0800

    Remove redundant code from OLED script (#547)

commit d8828da690
Author: akuker <34318535+akuker@users.noreply.github.com>
Date:   Sun Dec 19 21:02:50 2021 -0600

    Added list of sponsors

commit bcd7e8396d
Author: Daniel Markstedt <markstedt@gmail.com>
Date:   Sun Dec 19 15:51:45 2021 -0800

    Second attempt at properly creating the manpage dir (#542)

commit c887edfc8c
Author: Daniel Markstedt <markstedt@gmail.com>
Date:   Sun Dec 19 15:50:03 2021 -0800

    Remove special elevated privileges for the Web Interface (#536)

    * Use the pi_shutdown method to restart the rascsi service

    * Use the pi_shutdown method to restart the rascsi service

    * Remove modifications to sudoers no longer needed

    * Introduce sleeps attempting to connect to socket; reduce overall number of retries

    * Remove systemd helped methods and the functionality that depends on it

    * Attempts to speed up splash code

    * Remove unneccessary verbosity

    * Attempt to optimize service definition

commit 801aebfb96
Author: Daniel Markstedt <markstedt@gmail.com>
Date:   Sun Dec 19 15:47:22 2021 -0800

    More readable message when downloading a file (#531)

commit 29cf58288f
Author: Daniel Markstedt <markstedt@gmail.com>
Date:   Sun Dec 19 15:47:03 2021 -0800

    Add a warning notice when ejecting removable media (#526)

commit 7efa895239
Author: Daniel Markstedt <markstedt@gmail.com>
Date:   Sun Dec 19 15:46:22 2021 -0800

    Unzip zipfiles before storing to iso (#525)

    * Unzip zipfiles before storing to iso

    * Add helptext

    * Skip unzip for MacZip format

    * Should not be an fstring

commit 39bc485671
Author: Daniel Markstedt <markstedt@gmail.com>
Date:   Sun Dec 19 15:28:22 2021 -0800

    Add pip3 to global dependencies; remove duplicates from monitor_rascs… (#523)

    * Add pip3 to global dependencies; remove duplicates from monitor_rascsi dependencies

    * Cleanup

commit 670356e0e2
Author: Uwe Seimet <Uwe.Seimet@seimet.de>
Date:   Sun Dec 19 20:26:03 2021 +0100

    Code cleanup

commit 4fc8f67975
Author: Uwe Seimet <Uwe.Seimet@seimet.de>
Date:   Sun Dec 19 20:21:10 2021 +0100

    Manpage update

commit 29603a327a
Author: Uwe Seimet <Uwe.Seimet@seimet.de>
Date:   Sun Dec 19 19:49:56 2021 +0100

    Added optional folder name filter

commit ec31198d83
Author: Uwe Seimet <48174652+uweseimet@users.noreply.github.com>
Date:   Sun Dec 19 11:54:10 2021 +0100

    Optional authentication by access token (#529)

    * Added authentication by access token

    * No authentication is required for getting the rascsi version

    * Added comment

    * Interface description update

    * Manpage update

    * Added error code

    * Enum value update (backwards compatible)

    * Error code update

    * Error code update

    * Added CHECK_AUTHENTICATION

    * Comment update

    * VERSION_INFO also requires authentication

    * rasctl: Made token an optional parameter for -P

    * Fixed interface comment

commit e32211ef73
Author: Uwe Seimet <48174652+uweseimet@users.noreply.github.com>
Date:   Sun Dec 19 11:49:17 2021 +0100

    Recursive image file scan and image file filter (#532)

    * Extracted code

    * Initial support for (optional) recursive image file listings

    * Manpage update

    * Added support for image file filter

    * Updated filtering

    * Made image scan depth configurable

* Interface update

* Squashed commit of the following:

commit 6c98228726
Author: Uwe Seimet <Uwe.Seimet@seimet.de>
Date:   Mon Dec 20 22:45:24 2021 +0100

    Fixed scan depth check

commit 87e8b3be6a
Author: Uwe Seimet <Uwe.Seimet@seimet.de>
Date:   Mon Dec 20 20:46:36 2021 +0100

    Added depth to image info

commit 7c08fa6569
Author: Uwe Seimet <Uwe.Seimet@seimet.de>
Date:   Mon Dec 20 20:38:53 2021 +0100

    Interface comment updates

commit 29d919d30e
Author: Uwe Seimet <Uwe.Seimet@seimet.de>
Date:   Mon Dec 20 20:06:02 2021 +0100

    Error message update

commit fe76a1a577
Author: Uwe Seimet <Uwe.Seimet@seimet.de>
Date:   Mon Dec 20 19:56:36 2021 +0100

    Renaming

commit 412b53ddf1
Merge: bf9d906 958fb95
Author: Uwe Seimet <Uwe.Seimet@seimet.de>
Date:   Mon Dec 20 19:50:53 2021 +0100

    Merge branch 'develop' into feature_file_operations_with_folders

commit 958fb95908
Author: akuker <34318535+akuker@users.noreply.github.com>
Date:   Mon Dec 20 12:50:14 2021 -0600

    Adjust bus settle delay to match SCSI standard (#544)

    * Move the GCC v10 compiler flags into makefile instead of easyinstall.sh

    * #504 - Update the bus settle time to match the SCSI standard

    Co-authored-by: RaSCSI User <user@rascsi.com>

commit bf9d90664c
Author: Uwe Seimet <Uwe.Seimet@seimet.de>
Date:   Mon Dec 20 19:42:36 2021 +0100

    Fixed warning

commit 362a90f3dc
Author: Uwe Seimet <Uwe.Seimet@seimet.de>
Date:   Mon Dec 20 19:37:32 2021 +0100

    Updated error handling

commit 66c380bd97
Author: Uwe Seimet <Uwe.Seimet@seimet.de>
Date:   Mon Dec 20 19:33:01 2021 +0100

    Check image file nesting level

commit c98a2b9069
Author: Uwe Seimet <Uwe.Seimet@seimet.de>
Date:   Mon Dec 20 19:06:18 2021 +0100

    Fixed typo

commit a36dabc002
Author: Uwe Seimet <Uwe.Seimet@seimet.de>
Date:   Mon Dec 20 19:03:18 2021 +0100

    Code cleanup

commit 46fc22f72a
Author: Uwe Seimet <Uwe.Seimet@seimet.de>
Date:   Mon Dec 20 18:58:27 2021 +0100

    Delete empty folders

commit d55bf3e06f
Author: Uwe Seimet <Uwe.Seimet@seimet.de>
Date:   Mon Dec 20 18:33:59 2021 +0100

    Updated delete operation

commit 5afce5f50f
Author: Uwe Seimet <Uwe.Seimet@seimet.de>
Date:   Mon Dec 20 18:31:55 2021 +0100

    Copy/rename/create

commit b969d3990a
Author: Uwe Seimet <Uwe.Seimet@seimet.de>
Date:   Mon Dec 20 15:21:17 2021 +0100

    Cleanup

commit 200bc7251f
Author: Daniel Markstedt <markstedt@gmail.com>
Date:   Mon Dec 20 06:20:22 2021 -0800

    More helpful error message when IP does not resolve for OLED screen (#541)

    * More helpful error message

    * Remove confusing fallback IP

    * Tweak message

commit 6a6efa6bdd
Author: Uwe Seimet <Uwe.Seimet@seimet.de>
Date:   Mon Dec 20 12:58:29 2021 +0100

    Cleanup

commit 72ab669158
Author: Uwe Seimet <Uwe.Seimet@seimet.de>
Date:   Mon Dec 20 12:58:03 2021 +0100

    Check for existing folder

commit 6a9ac4d0da
Author: Uwe Seimet <Uwe.Seimet@seimet.de>
Date:   Mon Dec 20 12:52:26 2021 +0100

    Code cleanup, initial support for creating nested file

commit 4ae273ccbd
Author: akuker <34318535+akuker@users.noreply.github.com>
Date:   Sun Dec 19 22:30:22 2021 -0600

    Loopback tester pcb (#545)

commit 46c5c1966f
Author: akuker <34318535+akuker@users.noreply.github.com>
Date:   Sun Dec 19 22:29:59 2021 -0600

    RaSCSI Zero version 1.0 (#546)

commit d09df31d67
Author: Daniel Markstedt <markstedt@gmail.com>
Date:   Sun Dec 19 20:25:23 2021 -0800

    Remove redundant code from OLED script (#547)

commit d8828da690
Author: akuker <34318535+akuker@users.noreply.github.com>
Date:   Sun Dec 19 21:02:50 2021 -0600

    Added list of sponsors

commit bcd7e8396d
Author: Daniel Markstedt <markstedt@gmail.com>
Date:   Sun Dec 19 15:51:45 2021 -0800

    Second attempt at properly creating the manpage dir (#542)

commit c887edfc8c
Author: Daniel Markstedt <markstedt@gmail.com>
Date:   Sun Dec 19 15:50:03 2021 -0800

    Remove special elevated privileges for the Web Interface (#536)

    * Use the pi_shutdown method to restart the rascsi service

    * Use the pi_shutdown method to restart the rascsi service

    * Remove modifications to sudoers no longer needed

    * Introduce sleeps attempting to connect to socket; reduce overall number of retries

    * Remove systemd helped methods and the functionality that depends on it

    * Attempts to speed up splash code

    * Remove unneccessary verbosity

    * Attempt to optimize service definition

commit 801aebfb96
Author: Daniel Markstedt <markstedt@gmail.com>
Date:   Sun Dec 19 15:47:22 2021 -0800

    More readable message when downloading a file (#531)

commit 29cf58288f
Author: Daniel Markstedt <markstedt@gmail.com>
Date:   Sun Dec 19 15:47:03 2021 -0800

    Add a warning notice when ejecting removable media (#526)

commit 7efa895239
Author: Daniel Markstedt <markstedt@gmail.com>
Date:   Sun Dec 19 15:46:22 2021 -0800

    Unzip zipfiles before storing to iso (#525)

    * Unzip zipfiles before storing to iso

    * Add helptext

    * Skip unzip for MacZip format

    * Should not be an fstring

commit 39bc485671
Author: Daniel Markstedt <markstedt@gmail.com>
Date:   Sun Dec 19 15:28:22 2021 -0800

    Add pip3 to global dependencies; remove duplicates from monitor_rascs… (#523)

    * Add pip3 to global dependencies; remove duplicates from monitor_rascsi dependencies

    * Cleanup

commit ec31198d83
Author: Uwe Seimet <48174652+uweseimet@users.noreply.github.com>
Date:   Sun Dec 19 11:54:10 2021 +0100

    Optional authentication by access token (#529)

    * Added authentication by access token

    * No authentication is required for getting the rascsi version

    * Added comment

    * Interface description update

    * Manpage update

    * Added error code

    * Enum value update (backwards compatible)

    * Error code update

    * Error code update

    * Added CHECK_AUTHENTICATION

    * Comment update

    * VERSION_INFO also requires authentication

    * rasctl: Made token an optional parameter for -P

    * Fixed interface comment

commit e32211ef73
Author: Uwe Seimet <48174652+uweseimet@users.noreply.github.com>
Date:   Sun Dec 19 11:49:17 2021 +0100

    Recursive image file scan and image file filter (#532)

    * Extracted code

    * Initial support for (optional) recursive image file listings

    * Manpage update

    * Added support for image file filter

    * Updated filtering

    * Made image scan depth configurable

* Code cleanup

* Resolved merged issues

* Fixed merge issue

* Comment update

* Message update

* Fixed typo

* Logging update

* Logging update

* Logging update

* Fixed merge issue

* Set pattern param for SERVER_INFO

* Added missing break

* Updated error handling

* Logging update

* Error message update

* Removed initial approach for localization in remote interface

* Resolve merge conflicts

* Made 1 the default scan depth

Co-authored-by: Daniel Markstedt <markstedt@gmail.com>
2021-12-22 09:25:05 +01:00

475 lines
14 KiB
C++

//---------------------------------------------------------------------------
//
// SCSI Target Emulator RaSCSI (*^..^*)
// for Raspberry Pi
//
// Powered by XM6 TypeG Technology.
// Copyright (C) 2016-2020 GIMONS
//
//---------------------------------------------------------------------------
#include "os.h"
#include "filepath.h"
#include "fileio.h"
#include "log.h"
#include "gpiobus.h"
#include "rascsi_version.h"
#include "spdlog/spdlog.h"
#include <sys/time.h>
#include <climits>
#include <sstream>
#include <iostream>
#include "rascsi.h"
using namespace std;
//---------------------------------------------------------------------------
//
// Constant declarations
//
//---------------------------------------------------------------------------
#define MAX_BUFF_SIZE 1000000
// Symbol definition for the VCD file
// These are just arbitrary symbols. They can be anything allowed by the VCD file format,
// as long as they're consistently used.
#define SYMBOL_PIN_DAT '#'
#define SYMBOL_PIN_ATN '+'
#define SYMBOL_PIN_RST '$'
#define SYMBOL_PIN_ACK '%'
#define SYMBOL_PIN_REQ '^'
#define SYMBOL_PIN_MSG '&'
#define SYMBOL_PIN_CD '*'
#define SYMBOL_PIN_IO '('
#define SYMBOL_PIN_BSY ')'
#define SYMBOL_PIN_SEL '-'
#define SYMBOL_PIN_PHASE '='
// We'll use position 0 in the prev_value array to store the previous phase
#define PIN_PHASE 0
//---------------------------------------------------------------------------
//
// Variable declarations
//
//---------------------------------------------------------------------------
static BYTE prev_value[32] = {0xFF};
static volatile bool running; // Running flag
GPIOBUS *bus; // GPIO Bus
typedef struct data_capture{
DWORD data;
uint64_t timestamp;
} data_capture_t;
data_capture data_buffer[MAX_BUFF_SIZE];
DWORD data_idx = 0;
double ns_per_loop;
// We don't really need to support 256 character file names - this causes
// all kinds of compiler warnings when the log filename can be up to 256
// characters. _MAX_FNAME/2 is just an arbitrary value.
char log_file_name[_MAX_FNAME/2] = "log.vcd";
//---------------------------------------------------------------------------
//
// Signal Processing
//
//---------------------------------------------------------------------------
void KillHandler(int sig)
{
// Stop instruction
running = false;
}
//---------------------------------------------------------------------------
//
// Banner Output
//
//---------------------------------------------------------------------------
void Banner(int argc, char* argv[])
{
LOGINFO("SCSI Monitor Capture Tool - part of RaSCSI(*^..^*) ");
LOGINFO("version %s (%s, %s)\n",
rascsi_get_version_string(),
__DATE__,
__TIME__);
LOGINFO("Powered by XM6 TypeG Technology ");
LOGINFO("Copyright (C) 2016-2020 GIMONS");
LOGINFO("Copyright (C) 2020-2021 Contributors to the RaSCSI project");
LOGINFO("Connect type : %s", CONNECT_DESC);
LOGINFO(" %s - Value Change Dump file that can be opened with GTKWave", log_file_name);
if ((argc > 1 && strcmp(argv[1], "-h") == 0) ||
(argc > 1 && strcmp(argv[1], "--help") == 0)){
LOGINFO("Usage: %s [log filename]...", argv[0]);
exit(0);
}
else
{
LOGINFO(" ");
LOGINFO("Now collecting data.... Press CTRL-C to stop.")
LOGINFO(" ");
}
}
//---------------------------------------------------------------------------
//
// Initialization
//
//---------------------------------------------------------------------------
bool Init()
{
// Interrupt handler settings
if (signal(SIGINT, KillHandler) == SIG_ERR) {
return FALSE;
}
if (signal(SIGHUP, KillHandler) == SIG_ERR) {
return FALSE;
}
if (signal(SIGTERM, KillHandler) == SIG_ERR) {
return FALSE;
}
// GPIO Initialization
bus = new GPIOBUS();
if (!bus->Init()) {
LOGERROR("Unable to intiailize the GPIO bus. Exiting....");
return false;
}
// Bus Reset
bus->Reset();
// Other
running = false;
return true;
}
BOOL get_pin_value(DWORD data, int pin)
{
return (data >> pin) & 1;
}
BYTE get_data_field(DWORD data)
{
DWORD data_out =
((data >> (PIN_DT0 - 0)) & (1 << 7)) |
((data >> (PIN_DT1 - 1)) & (1 << 6)) |
((data >> (PIN_DT2 - 2)) & (1 << 5)) |
((data >> (PIN_DT3 - 3)) & (1 << 4)) |
((data >> (PIN_DT4 - 4)) & (1 << 3)) |
((data >> (PIN_DT5 - 5)) & (1 << 2)) |
((data >> (PIN_DT6 - 6)) & (1 << 1)) |
((data >> (PIN_DT7 - 7)) & (1 << 0));
return (BYTE)data_out;
}
void vcd_output_if_changed_phase(FILE *fp, DWORD data, int pin, char symbol)
{
BUS::phase_t new_value = GPIOBUS::GetPhaseRaw(data);
if (prev_value[pin] != new_value)
{
prev_value[pin] = new_value;
fprintf(fp, "s%s %c\n", GPIOBUS::GetPhaseStrRaw(new_value), symbol);
}
}
void vcd_output_if_changed_bool(FILE *fp, DWORD data, int pin, char symbol)
{
BOOL new_value = get_pin_value(data,pin);
if (prev_value[pin] != new_value)
{
prev_value[pin] = new_value;
fprintf(fp, "%d%c\n", new_value, symbol);
}
}
void vcd_output_if_changed_byte(FILE *fp, DWORD data, int pin, char symbol)
{
BYTE new_value = get_data_field(data);
if(prev_value[pin] != new_value)
{
prev_value[pin] = new_value;
fprintf(fp, "b%d%d%d%d%d%d%d%d %c\n",
get_pin_value(data,PIN_DT7),
get_pin_value(data,PIN_DT6),
get_pin_value(data,PIN_DT5),
get_pin_value(data,PIN_DT4),
get_pin_value(data,PIN_DT3),
get_pin_value(data,PIN_DT2),
get_pin_value(data,PIN_DT1),
get_pin_value(data,PIN_DT0), symbol);
}
}
void create_value_change_dump()
{
LOGINFO("Creating Value Change Dump file (%s)", log_file_name);
FILE *fp = fopen(log_file_name,"w");
// Get the current time
time_t rawtime;
time(&rawtime);
struct tm *timeinfo = localtime(&rawtime);
char timestamp[256];
strftime (timestamp,sizeof(timestamp),"%d-%m-%Y %H-%M-%S",timeinfo);
fprintf(fp, "$date\n");
fprintf(fp, "%s\n", timestamp);
fprintf(fp, "$end\n");
fprintf(fp, "$version\n");
fprintf(fp, " VCD generator tool version info text.\n");
fprintf(fp, "$end\n");
fprintf(fp, "$comment\n");
fprintf(fp, " Tool build date:%s\n", __TIMESTAMP__);
fprintf(fp, "$end\n");
fprintf(fp, "$timescale 1 ns $end\n");
fprintf(fp, "$scope module logic $end\n");
fprintf(fp, "$var wire 1 %c BSY $end\n", SYMBOL_PIN_BSY);
fprintf(fp, "$var wire 1 %c SEL $end\n", SYMBOL_PIN_SEL);
fprintf(fp, "$var wire 1 %c CD $end\n", SYMBOL_PIN_CD);
fprintf(fp, "$var wire 1 %c IO $end\n", SYMBOL_PIN_IO);
fprintf(fp, "$var wire 1 %c MSG $end\n", SYMBOL_PIN_MSG);
fprintf(fp, "$var wire 1 %c REQ $end\n", SYMBOL_PIN_REQ);
fprintf(fp, "$var wire 1 %c ACK $end\n", SYMBOL_PIN_ACK);
fprintf(fp, "$var wire 1 %c ATN $end\n", SYMBOL_PIN_ATN);
fprintf(fp, "$var wire 1 %c RST $end\n", SYMBOL_PIN_RST);
fprintf(fp, "$var wire 8 %c data $end\n", SYMBOL_PIN_DAT);
fprintf(fp, "$var string 1 %c phase $end\n", SYMBOL_PIN_PHASE);
fprintf(fp, "$upscope $end\n");
fprintf(fp, "$enddefinitions $end\n");
// Initial values - default to zeros
fprintf(fp, "$dumpvars\n");
fprintf(fp, "0%c\n", SYMBOL_PIN_BSY);
fprintf(fp, "0%c\n", SYMBOL_PIN_SEL);
fprintf(fp, "0%c\n", SYMBOL_PIN_CD);
fprintf(fp, "0%c\n", SYMBOL_PIN_IO);
fprintf(fp, "0%c\n", SYMBOL_PIN_MSG);
fprintf(fp, "0%c\n", SYMBOL_PIN_REQ);
fprintf(fp, "0%c\n", SYMBOL_PIN_ACK);
fprintf(fp, "0%c\n", SYMBOL_PIN_ATN);
fprintf(fp, "0%c\n", SYMBOL_PIN_RST);
fprintf(fp, "b00000000 %c\n", SYMBOL_PIN_DAT);
fprintf(fp, "$end\n");
DWORD i = 0;
while (i < data_idx)
{
ostringstream s;
s << (uint64_t)(data_buffer[i].timestamp*ns_per_loop);
fprintf(fp, "#%s\n",s.str().c_str());
vcd_output_if_changed_bool(fp, data_buffer[i].data, PIN_BSY, SYMBOL_PIN_BSY);
vcd_output_if_changed_bool(fp, data_buffer[i].data, PIN_SEL, SYMBOL_PIN_SEL);
vcd_output_if_changed_bool(fp, data_buffer[i].data, PIN_CD, SYMBOL_PIN_CD);
vcd_output_if_changed_bool(fp, data_buffer[i].data, PIN_IO, SYMBOL_PIN_IO);
vcd_output_if_changed_bool(fp, data_buffer[i].data, PIN_MSG, SYMBOL_PIN_MSG);
vcd_output_if_changed_bool(fp, data_buffer[i].data, PIN_REQ, SYMBOL_PIN_REQ);
vcd_output_if_changed_bool(fp, data_buffer[i].data, PIN_ACK, SYMBOL_PIN_ACK);
vcd_output_if_changed_bool(fp, data_buffer[i].data, PIN_ATN, SYMBOL_PIN_ATN);
vcd_output_if_changed_bool(fp, data_buffer[i].data, PIN_RST, SYMBOL_PIN_RST);
vcd_output_if_changed_byte(fp, data_buffer[i].data, PIN_DT0, SYMBOL_PIN_DAT);
vcd_output_if_changed_phase(fp, data_buffer[i].data, PIN_PHASE, SYMBOL_PIN_PHASE);
i++;
}
fclose(fp);
}
void Cleanup()
{
LOGINFO("Stopping data collection....");
create_value_change_dump();
// Cleanup the Bus
bus->Cleanup();
delete bus;
}
void Reset()
{
// Reset the bus
bus->Reset();
}
//---------------------------------------------------------------------------
//
// Pin the thread to a specific CPU
//
//---------------------------------------------------------------------------
void FixCpu(int cpu)
{
// Get the number of CPUs
cpu_set_t cpuset;
CPU_ZERO(&cpuset);
sched_getaffinity(0, sizeof(cpu_set_t), &cpuset);
int cpus = CPU_COUNT(&cpuset);
// Set the thread affinity
if (cpu < cpus) {
CPU_ZERO(&cpuset);
CPU_SET(cpu, &cpuset);
sched_setaffinity(0, sizeof(cpu_set_t), &cpuset);
}
}
#ifdef DEBUG
static DWORD high_bits = 0x0;
static DWORD low_bits = 0xFFFFFFFF;
#endif
//---------------------------------------------------------------------------
//
// Main processing
//
//---------------------------------------------------------------------------
int main(int argc, char* argv[])
{
ostringstream s;
#ifdef DEBUG
DWORD prev_high = high_bits;
DWORD prev_low = low_bits;
#endif
DWORD prev_sample = 0xFFFFFFFF;
DWORD this_sample = 0;
struct sched_param schparam;
timeval start_time;
timeval stop_time;
uint64_t loop_count = 0;
timeval time_diff;
uint64_t elapsed_us;
int str_len;
// If there is an argument specified and it is NOT -h or --help
if((argc > 1) && (strcmp(argv[1], "-h")) && (strcmp(argv[1], "--help"))){
str_len = strlen(argv[1]);
if ((str_len >= 1) && (str_len < _MAX_FNAME))
{
strncpy(log_file_name, argv[1], sizeof(log_file_name));
// Append .vcd if its not already there
if((str_len < 4) || strcasecmp(log_file_name + (str_len - 4), ".vcd")) {
strcat(log_file_name, ".vcd");
}
}
else
{
printf("Invalid log name specified. Using log.vcd");
}
}
#ifdef DEBUG
spdlog::set_level(spdlog::level::trace);
#else
spdlog::set_level(spdlog::level::info);
#endif
spdlog::set_pattern("%^[%l]%$ %v");
// Output the Banner
Banner(argc, argv);
memset(data_buffer,0,sizeof(data_buffer));
// Initialize
int ret = 0;
if (!Init()) {
ret = EPERM;
goto init_exit;
}
// Reset
Reset();
// Set the affinity to a specific processor core
FixCpu(3);
// Scheduling policy setting (highest priority)
schparam.sched_priority = sched_get_priority_max(SCHED_FIFO);
sched_setscheduler(0, SCHED_FIFO, &schparam);
// Start execution
running = true;
bus->SetACT(FALSE);
(void)gettimeofday(&start_time, NULL);
LOGDEBUG("ALL_SCSI_PINS %08X\n",ALL_SCSI_PINS);
// Main Loop
while (running) {
// Work initialization
this_sample = (bus->Aquire() & ALL_SCSI_PINS);
loop_count++;
if (loop_count > LLONG_MAX -1)
{
LOGINFO("Maximum amount of time has elapsed. SCSIMON is terminating.");
running=false;
}
if (data_idx >= (MAX_BUFF_SIZE-2))
{
LOGINFO("Internal data buffer is full. SCSIMON is terminating.");
running=false;
}
if (this_sample != prev_sample)
{
#ifdef DEBUG
// This is intended to be a debug check to see if every pin is set
// high and low at some point.
high_bits |= this_sample;
low_bits &= this_sample;
if ((high_bits != prev_high) || (low_bits != prev_low))
{
LOGDEBUG(" %08X %08X\n",high_bits, low_bits);
}
prev_high = high_bits;
prev_low = low_bits;
if((data_idx % 1000) == 0){
s.str("");
s << "Collected " << data_idx << " samples...";
LOGDEBUG("%s", s.str().c_str());
}
#endif
data_buffer[data_idx].data = this_sample;
data_buffer[data_idx].timestamp = loop_count;
data_idx++;
prev_sample = this_sample;
}
continue;
}
// Collect one last sample, otherwise it looks like the end of the data was cut off
if (data_idx < MAX_BUFF_SIZE)
{
data_buffer[data_idx].data = this_sample;
data_buffer[data_idx].timestamp = loop_count;
data_idx++;
}
(void)gettimeofday(&stop_time, NULL);
timersub(&stop_time, &start_time, &time_diff);
elapsed_us = ((time_diff.tv_sec*1000000) + time_diff.tv_usec);
s.str("");
s << "Elapsed time: " << elapsed_us << " microseconds (" << elapsed_us / 1000000 << " seconds)";
LOGINFO("%s", s.str().c_str());
s.str("");
s << "Collected " << data_idx << " changes";
LOGINFO("%s", s.str().c_str());
// Note: ns_per_loop is a global variable that is used by Cleanup() to printout the timestamps.
ns_per_loop = (elapsed_us * 1000) / (double)loop_count;
s.str("");
s << "Read the SCSI bus " << loop_count << " times with an average of " << ns_per_loop << " ns for each read";
LOGINFO("%s", s.str().c_str());
Cleanup();
init_exit:
exit(ret);
}